:orphan:
# VecNestGetSubVec
Returns a single, sub-vector from a nest vector.
## Synopsis
```
#include "petscvec.h"
PetscErrorCode VecNestGetSubVec(Vec X, PetscInt idxm, Vec *sx)
```
Not Collective
## Input Parameters
- ***X -*** nest vector
- ***idxm -*** index of the vector within the nest
## Output Parameter
- ***sx -*** vector at index `idxm` within the nest
## See Also
`VECNEST`, [](ch_vectors), `Vec`, `VecType`, `VecNestGetSize()`, `VecNestGetSubVecs()`
## Level
developer
## Location
src/vec/vec/impls/nest/vecnest.c
## Examples
src/ksp/ksp/tutorials/ex27.c
## Implementations
VecNestGetSubVec_Nest in src/vec/vec/impls/nest/vecnest.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/impls/nest/vecnest.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)