:orphan:
# MatNestSetSubMats
Sets the nested submatrices in a `MATNEST`
## Synopsis
```
#include "petscmat.h"
PetscErrorCode MatNestSetSubMats(Mat A, PetscInt nr, const IS is_row[], PetscInt nc, const IS is_col[], const Mat a[])
```
Collective
## Input Parameters
- ***A -*** `MATNEST` matrix
- ***nr -*** number of nested row blocks
- ***is_row -*** index sets for each nested row block, or `NULL` to make contiguous
- ***nc -*** number of nested column blocks
- ***is_col -*** index sets for each nested column block, or `NULL` to make contiguous
- ***a -*** row-aligned array of nr*nc submatrices, empty submatrices can be passed using `NULL`
## Note
This always resets any submatrix information previously set
## See Also
[](ch_matrices), `Mat`, `MATNEST`, `MatCreateNest()`, `MatNestSetSubMat()`, `MatNestGetSubMat()`, `MatNestGetSubMats()`
## Level
advanced
## Location
src/mat/impls/nest/matnest.c
## Implementations
MatNestSetSubMats_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)