[SciPy-user] Re : Re : io.loadmat and mat_struct object

Mickael mickael.paris@gmail....
Tue May 12 05:36:36 CDT 2009


2009/5/12, Nils Wagner <nwagner@iam.uni-stuttgart.de>:
> On Tue, 12 May 2009 11:49:15 +0200
>   Mickael <mickael.paris@gmail.com> wrote:
>> 2009/5/12, Nils Wagner <nwagner@iam.uni-stuttgart.de>:
>>> Hi all,
>>>
>>> How can I obtain the contents of the mat_struct object ?
>>>
>>>>>> A['test_struct']
>>> array([[<scipy.io.matlab.mio5.mat_struct object at
>>> 0x2a9a0fb150>]], dtype=object)
>>>
>>>
>>> Any pointer would be appreciated.
>>>
>>>       Nils
>>>
>>> _______________________________________________
>>> SciPy-user mailing list
>>> SciPy-user@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>>
>> Hi Nils,
>>
>> have you seen the informations inside the cookbook :
>>
>> http://www.scipy.org/Cookbook/Reading_mat_files
>>
>> Mickael.
>
> Hi Mickael,
>
> Thank you for the pointer. However the cookbook is very
> short. How do I access arrays of structures ?
>

I've just seen that your question is about struct in mat...

> An example would be appreciated.

you can specified the format when you load a Matlab structure with this option :

struct_as_record : {False, True} optional

temp =   io.loadmat('test.mat',struct_as_record:True) (False is the
default for the moment: thus structures are loaded as objects. With
True, structures are laoded as array) by the way, you must be able to
get access to yours arrays)



> Cheers,
>                Nils
>
Mickael.

> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-user mailing list