[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

petsc to matlab



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.