What files should one use to convert vectors from Matlab to PETSc (PetscBinaryWrite is for square matrices)? I have attempted to write directly to binary from Matlab a matrix + vector, and only a vector (using save command with the -mat option), then read the binary file into PETSc (using ex34.c in ...src/mat/tests), however the format is not recognized.<br>
<br>Thanks,<br><br>Tom<br><br><div class="gmail_quote">On Tue, Oct 26, 2010 at 3:57 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Use PetscBinaryWrite('filename',sparsematlabmatrix) I do not know why your second argument has quotes around it.<br>
<font color="#888888"><br>
Barry<br>
</font><div><div></div><div class="h5"><br>
<br>
On Oct 26, 2010, at 3:33 PM, Nunion wrote:<br>
<br>
> Hello,<br>
><br>
> 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;<br>
><br>
> 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.<br>
><br>
> Thanks in advance,<br>
><br>
> Tom<br>
<br>
</div></div></blockquote></div><br>