[petsc-users] Import Matlab matrix

Jed Brown jed at jedbrown.org
Fri Jul 29 11:00:46 CDT 2022


You can use share/petsc/matlab/PetscBinaryWrite.m.

matlab> PetscBinaryWrite('matrix.petsc', sparse(A))

Then load it with MatLoad in PETSc.

Ahmed Mansur <ahmedlp9 at gmail.com> writes:

> How to import a sparse matrix from Matlab using C++ and PETSC , if anyone
> has any example code, thanks


More information about the petsc-users mailing list