# MatGetType

Gets the matrix type as a string from the matrix object.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode PETSCMAT_DLLEXPORT MatGetType(Mat mat,MatType *type)

Not Collective

### Input Parameter

mat -the matrix

### Output Parameter

name -name of matrix type

### Keywords

Mat, MatType, get, method, name

### C++ variants

| MatType MatGetType(Mat mat) |  | -> |  | MatGetType(mat,&t); return t;

### See Also

MatSetType()

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