[petsc-users] Writing PETSc matrices

Barry Smith bsmith at mcs.anl.gov
Tue Oct 26 15:57:04 CDT 2010


   Use PetscBinaryWrite('filename',sparsematlabmatrix)  I do not know why your second argument has quotes around it.

   Barry


On Oct 26, 2010, at 3:33 PM, Nunion wrote:

> Hello, 
> 
> I am new to PETSc and programming.  I have a question concerning writing PETSc matrices in binary from binary matrices [compressessed/uncompressed] generated in Matlab.  I am attempting to use the files in the /bin/matlab directory, in particular the PetscBinaryWrite.m file.  However, the usage;
> 
> PetscBinaryWrite('matrix.mat','output.ex') does not seem to work.  I also tried using the examples in the /mat directory however, matlab does not support the writing of complex matrices in ASCII.
> 
> Thanks in advance,
> 
> Tom



More information about the petsc-users mailing list