.mat file not converting to .csv

4 ビュー (過去 30 日間)
Hunter Mitchell
Hunter Mitchell 2020 年 6 月 7 日
コメント済み: Ameer Hamza 2020 年 6 月 7 日
I'm trying to work with data from https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/ . They provide a .mat file that contains gender, age, name, etc. corresponding to facial images. As I primarily work in Python, I would like to convert this to a csv file. I load the .mat file into Octave, and it gives this when I type 'whos':
Attr Name Size Bytes Class
==== ==== ==== ===== =====
FileData 1x1 7215591 struct
As I have been reading online, since it is a struct, I need to specify which variables to convert to csv for it to export properly. However, I don't know how to find a list for which variables I can enter. I also can't understand the way they stored the data. I would like to export all of the data, since I can pick and choose easier once it's in Python, but I just keep running into errors and don't know how to explore data very well in Matlab. Please Help!

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 6 月 7 日
編集済み: Ameer Hamza 2020 年 6 月 7 日
Following works in MATLAB
M = structfun(@(x) x.', wiki, 'UniformOutput', 0);
T = struct2table(M);
writetable(T, 'test.csv');
The csv file for the mat file in the question is attached to this answer.
  2 件のコメント
Hunter Mitchell
Hunter Mitchell 2020 年 6 月 7 日
omg dude you're the goat thank youuuuuuuuu
Ameer Hamza
Ameer Hamza 2020 年 6 月 7 日
I am glad to be of help :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by