# MatCompositeGetMat
Returns the ith matrix from the composite matrix. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatCompositeGetMat(Mat mat, PetscInt i, Mat *Ai)
```
Logically Collective


## Input Parameters

- ***mat -*** the composite matrix
- ***i -*** the number of requested matrix



## Output Parameter

- ***Ai -*** ith matrix in composite





## See Also
 `MatCreateComposite()`, `MatCompositeGetNumberMat()`, `MatCompositeAddMat()`, `MATCOMPOSITE`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/composite/mcomposite.c.html#MatCompositeGetMat">src/mat/impls/composite/mcomposite.c</A>

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/composite/mcomposite.c.html#MatCompositeGetMat_Composite">MatCompositeGetMat_Composite in src/mat/impls/composite/mcomposite.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/composite/mcomposite.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)  
