:orphan:
# MatNullSpaceDestroy
Destroys a data structure used to project vectors out of null spaces.
## Synopsis
```
#include "petscmat.h"
PetscErrorCode MatNullSpaceDestroy(MatNullSpace *sp)
```
Collective
## Input Parameter
- ***sp -*** the null space context to be destroyed
## See Also
[](ch_matrices), `Mat`, `MatNullSpace`, `MatNullSpaceCreate()`, `MatNullSpaceRemove()`, `MatNullSpaceSetFunction()`
## Level
advanced
## Location
src/mat/interface/matnull.c
## Examples
src/dm/impls/stag/tutorials/ex2.c
src/dm/impls/stag/tutorials/ex3.c
src/dm/impls/stag/tutorials/ex4.c
src/ksp/ksp/tutorials/ex29.c
src/ksp/ksp/tutorials/ex32.c
src/ksp/ksp/tutorials/ex34.c
src/ksp/ksp/tutorials/ex35.cxx
src/ksp/ksp/tutorials/ex36.cxx
src/ksp/ksp/tutorials/ex49.c
src/ksp/ksp/tutorials/ex50.c
src/ksp/ksp/tutorials/ex56.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/interface/matnull.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)