:orphan:
# VecMedian
Computes the componentwise median of three vectors and stores the result in this vector.  Used primarily for projecting a vector within upper and lower bounds. 
## Synopsis
```
#include "petscvec.h"  
PetscErrorCode VecMedian(Vec Vec1, Vec Vec2, Vec Vec3, Vec VMedian)
```
Logically Collective


## Input Parameters

- ***Vec1 -*** The first vector
- ***Vec2 -*** The second vector
- ***Vec3 -*** The third vector



## Output Parameter

- ***VMedian -*** The median vector (this can be any one of the input vectors)





## See Also
 `Vec`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/utils/projection.c.html#VecMedian">src/vec/vec/utils/projection.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/utils/projection.c)


[Index of all Vec routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
