Nov-15-2017, 11:04 AM
Hi! I'm trying to import a .mat file that contains a cell array. In matlab I did this:
a={'element1';'element2';'element3'};
save('m.mat','-v7','a')
I used '-v7' because, in python, I use 'scipy.io' and 'loadmat' that can be used only with version 7. In python:
import scipy.io as sio
i=sio.loadmat('m.mat')
i.keys()
And I get:
dict_keys(['__header__', '__version__', '__globals__', 'a'])
Finally, I use the key 'a':
k=i['a']
In the variable explorer I get k, that is a object type but I can't access to its elements. How can I convert it to a list?
![[Image: KXnVn.jpg]](https://i.stack.imgur.com/KXnVn.jpg)
Thank you
a={'element1';'element2';'element3'};
save('m.mat','-v7','a')
I used '-v7' because, in python, I use 'scipy.io' and 'loadmat' that can be used only with version 7. In python:
import scipy.io as sio
i=sio.loadmat('m.mat')
i.keys()
And I get:
dict_keys(['__header__', '__version__', '__globals__', 'a'])
Finally, I use the key 'a':
k=i['a']
In the variable explorer I get k, that is a object type but I can't access to its elements. How can I convert it to a list?
![[Image: KXnVn.jpg]](https://i.stack.imgur.com/KXnVn.jpg)
Thank you