:orphan:
# MatNestGetSubMat
Returns a single, sub-matrix from a `MATNEST`
## Synopsis
```
#include "petscmat.h"
PetscErrorCode MatNestGetSubMat(Mat A, PetscInt idxm, PetscInt jdxm, Mat *sub)
```
Not Collective
## Input Parameters
- ***A -*** `MATNEST` matrix
- ***idxm -*** index of the matrix within the nest matrix
- ***jdxm -*** index of the matrix within the nest matrix
## Output Parameter
- ***sub -*** matrix at index `idxm`, `jdxm` within the nest matrix
## See Also
[](ch_matrices), `Mat`, `MATNEST`, `MatNestGetSize()`, `MatNestGetSubMats()`, `MatCreateNest()`, `MATNEST`, `MatNestSetSubMat()`,
`MatNestGetLocalISs()`, `MatNestGetISs()`
## Level
developer
## Location
src/mat/impls/nest/matnest.c
## Implementations
MatNestGetSubMat_Nest in src/mat/impls/nest/matnest.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/nest/matnest.c)
[Index of all Mat routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)