# MatSetVecType
Set the vector type the matrix will return with `MatCreateVecs()` 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatSetVecType(Mat mat, VecType vtype)
```
Collective


## Input Parameters

- ***mat   -*** the matrix object
- ***vtype -*** vector type



## Note
This is rarely needed in practice since each matrix object internally sets the proper vector type.




## See Also
 `VecType`, `VecSetType()`, `MatGetVecType()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/interface/matreg.c.html#MatSetVecType">src/mat/interface/matreg.c</A>


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