# 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
 `MATNEST`, `MatNestGetSize()`, `MatNestGetSubMats()`, `MatCreateNest()`, `MATNEST`, `MatNestSetSubMat()`,
`MatNestGetLocalISs()`, `MatNestGetISs()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/nest/matnest.c.html#MatNestGetSubMat">src/mat/impls/nest/matnest.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/nest/matnest.c.html#MatNestGetSubMat_Nest">MatNestGetSubMat_Nest in src/mat/impls/nest/matnest.c</A><BR>


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