:orphan:
# MatSetBlockSizesFromMats
Sets the matrix block row and column sizes to match a pair of matrices
## Synopsis
```
#include "petscmat.h"
PetscErrorCode MatSetBlockSizesFromMats(Mat mat, Mat fromRow, Mat fromCol)
```
Logically Collective
## Input Parameters
- ***mat -*** the matrix
- ***fromRow -*** matrix from which to copy row block size
- ***fromCol -*** matrix from which to copy column block size (can be same as fromRow)
## See Also
[](ch_matrices), `Mat`, `MatCreateSeqBAIJ()`, `MatCreateBAIJ()`, `MatGetBlockSize()`, `MatSetBlockSizes()`
## Level
developer
## Location
src/mat/interface/matrix.c
## Examples
src/ksp/ksp/tutorials/ex76.c
src/ksp/ksp/tutorials/ex76f.F90
---
[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)