petsc to matlab

billy at dem.uminho.pt billy at dem.uminho.pt
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);

  PetscViewerDestroy(view);



Billy.




More information about the petsc-users mailing list