Hi all, I have .mat file which has 11 different parameters in it, say par1, par2,par3, etc. Is there any way to save this "mat" file as a CSV file? I want to have the name of the parameters (par1,par2, ...) on the first row of the CSV as well.
Thanks

2 件のコメント

Paolo
Paolo 2018 年 6 月 7 日
What are the contents of par1, par2, par3? Can you add your .mat file to your question?
Roozbeh Yousefnejad
Roozbeh Yousefnejad 2018 年 6 月 7 日
different parameters with 101 data in each one. Sure, I've attached it to this comnt.
First I need to transpose them to have each parameter in one column. then I want to put them together in one CSV file and on the first row add the name of each parameter.

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

 採用された回答

Onur Kapucu
Onur Kapucu 2018 年 6 月 7 日
編集済み: Onur Kapucu 2018 年 6 月 7 日

0 投票

This should do it
EL_struct = open('el.mat');
EL_transposed = structfun(@transpose,EL_struct,'UniformOutput',false);
data = struct2table(EL_transposed);
writetable(data);

3 件のコメント

Roozbeh Yousefnejad
Roozbeh Yousefnejad 2018 年 6 月 7 日
編集済み: Roozbeh Yousefnejad 2018 年 6 月 7 日
Wow thanks, honestly, what you did is more than my knowledge;-) it almost works for me. the only things is that the output a note file. Do you think I can use csvwrite to make an csv file?
Paolo
Paolo 2018 年 6 月 7 日
Change
writetable(data)
to
writetable(data,'el.csv');
Roozbeh Yousefnejad
Roozbeh Yousefnejad 2018 年 6 月 7 日
Fantastic. Thank you so much Onur and Paolo. you helped me a lot. thanks

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

製品

リリース

R2017b

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by