petsc to matlab

billy at dem.uminho.pt billy at dem.uminho.pt
Thu Mar 2 15:08:53 CST 2006


It creates a file with the following format and I don't know how to import this
data into matlab.

row 0: (0, -0.939141)  (1, 0.234784)  (98, 0.234784)  (288, 0.234786)  (297,
0.234786) 
row 1: (0, 0.234784)  (1, -0.939141)  (2, 0.234786)  (3, 0.234786)  (107, 0.234784) 
row 2: (1, 0.234786)  (2, -0.939134)  (4, 0.234782)  (297, 0.23478)  (305,
0.234786) 
...

Billy.

Quoting Matthew Knepley <knepley at mcs.anl.gov>:

> billy at dem.uminho.pt writes:
> 
>        What goes wrong?
> 
>             Matt
> 
> > 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.
> >
> >
> >
> 
> -- 
> "Failure has a thousand explanations. Success doesn't need one" -- Sir Alec
> Guiness
> 
> 





More information about the petsc-users mailing list