Converting .mat file in a txt

Hi,
I've received a .mat file but I do not have Matlab available. So I loaded it into Compose and saw its structure composition. Now I'm trying to convert it into an accessible .txt or .csv file to handle the data. Is it possible? Which commands should I use to extract the structures?
Thanks a lot!
Mattia
Best Answer
-
Ciao Mattia,
after you load a mat file to Compose, you should see that the Variable Browser gets populated with the variables contained in the mat file.
If inside this mat file there are also structs, you can access every filed of the structs with the "." operator.
For example, if you have a struct called mystruct with a certain field called myfield, you can access it through:
mystruct.myfield
Supposing that this field contains a matrix, you can then save it to a csv file as follows:
csvwrite('mycsvfile.csv', mystruct.myfield);
Note that you can give the absolute path (instead of just the name) as the 1st argument of csvwrite function, if you want to save the csv file in a specific folder.
Hope it helps,
Lorenzo
1
Answers
-
Ciao Mattia,
after you load a mat file to Compose, you should see that the Variable Browser gets populated with the variables contained in the mat file.
If inside this mat file there are also structs, you can access every filed of the structs with the "." operator.
For example, if you have a struct called mystruct with a certain field called myfield, you can access it through:
mystruct.myfield
Supposing that this field contains a matrix, you can then save it to a csv file as follows:
csvwrite('mycsvfile.csv', mystruct.myfield);
Note that you can give the absolute path (instead of just the name) as the 1st argument of csvwrite function, if you want to save the csv file in a specific folder.
Hope it helps,
Lorenzo
1 -
Ciao,
I missed the "." operator to navigate through the structure. With this, I could operate within the structure freely.
Thanks for the support!
Mattia
0