# 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



## Notes




## See Also
 `VecNestGetSize()`, `VecNestGetSubVecs()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/nest/vecnest.c.html#VecNestGetSubVec">src/vec/vec/impls/nest/vecnest.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex27.c.html">src/ksp/ksp/tutorials/ex27.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/nest/vecnest.c.html#VecNestGetSubVec_Nest">VecNestGetSubVec_Nest in src/vec/vec/impls/nest/vecnest.c</A><BR>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
