petsc to matlab

billy at billy at
Thu Mar 2 14:43:41 CST 2006

How can I save the matrix in PETSc and load it in matlab?

I tried this but it does not work:

  PetscViewer view;

  PetscViewerCreate (PETSC_COMM_WORLD, &view);

  PetscViewerSetFormat (view, PETSC_VIEWER_ASCII_MATLAB);

  PetscViewerAsciiOpen(PETSC_COMM_WORLD, "matrix.mat", &view);
  MatView(A, view);



More information about the petsc-users mailing list