# MatDestroy

Frees space taken by a matrix.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode PETSCMAT_DLLEXPORT MatDestroy(Mat A)

Collective on Mat

### Input Parameter

A -the matrix

Level:beginner
Location:src/mat/interface/matrix.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/mat/examples/tutorials/ex1.c.html
src/mat/examples/tutorials/ex4.c.html
src/mat/examples/tutorials/ex5.c.html
src/mat/examples/tutorials/ex6.c.html
src/ksp/pc/examples/tutorials/ex1.c.html
src/ksp/pc/examples/tutorials/ex2.c.html
src/ksp/examples/tutorials/ex1.c.html
src/ksp/examples/tutorials/ex2.c.html
src/ksp/examples/tutorials/ex3.c.html
src/ksp/examples/tutorials/ex4.c.html
src/ksp/examples/tutorials/ex5.c.html