how to load a matlab matrix?

Barry Smith bsmith at mcs.anl.gov
Fri Sep 26 11:27:38 CDT 2008


    I do not understand your question.

    You can use the PETSc binary viewer to move matrices/vectors back  
and forth between PETSc and Matlab.

    Barry

On Sep 26, 2008, at 10:40 AM, zhifeng sheng wrote:

> Barry Smith wrote:
>>
>> On Sep 26, 2008, at 10:19 AM, zhifeng sheng wrote:
>>
>>> Dear all
>>>
>>> I know that Petsc can print a matrix in matlab format. can it read  
>>> a matlab format matrix? (in the same format, it prints?)
>>>
>>
>>   No, if you want to read/write for Matlab you should use the  
>> binary format. The Matlab programs
>> in bin/matlab/PetscBinaryRead/Write.m are for use in Matlab.
>>
>>   Reason: the ASCII format for reading/writing is VERY slow for  
>> larger matrices. The binary format is fast.
>>
>>
>>   Barry
>>
>>> I check Matload, and it does not work.
>>>
>>> Thanks a lot
>>> best regards
>>> Zhifeng
>>>
>>
> But I am a matlab  script as big as 1.2 G, and matlab can not handle  
> it....
>
> I am hoping by putting it in petsc, I can do something with it.
>
> Any suggestions?
>
> thanks
> Zhifeng
>




More information about the petsc-users mailing list