:orphan:
# MatGetNullSpace
retrieves the null space of a matrix.
## Synopsis
```
#include "petscmat.h"
PetscErrorCode MatGetNullSpace(Mat mat, MatNullSpace *nullsp)
```
Logically Collective
## Input Parameters
- ***mat -*** the matrix
- ***nullsp -*** the null space object
## See Also
[](ch_matrices), `Mat`, `MatCreate()`, `MatNullSpaceCreate()`, `MatSetNearNullSpace()`, `MatSetNullSpace()`, `MatNullSpace`
## Level
developer
## Location
src/mat/interface/matrix.c
## Examples
src/ksp/ksp/tutorials/ex73.c
src/snes/tutorials/ex69.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/interface/matrix.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)