フィルターのクリア

How to save to a csv file?

11 ビュー (過去 30 日間)
Tomaszzz
Tomaszzz 2022 年 3 月 10 日
コメント済み: Tomaszzz 2022 年 3 月 10 日
Hi all,
I have 20 folders with mutiple mat files which are 1 x 1 structures with a 1 x 54 table as in the image below (showing just first 10 columns)
I managed to list all folders and all the desired files.
I want to access each structure from all folders and save as one csv file which will be a 20x54 table. Below is what I got and saving to a csv file gives me issues. Can you help please?
for k = 1:numel(sq_dot_1) % for list of mat files
if isempty(sq_dot_1{k})
continue
end
disp(sq_dot_1{k}.name)
A = fullfile(topLevelFolder,subFolders(k).name,sq_dot_1{k}.name);
Dot1 = load(A); %load data
writetable(Dot1.Stats(k), 'sq_Dot1.csv'); % save to csv file
end
Subscripting into a table using one subscript (as in t(i)) or three or more subscripts (as in t(i,j,k)) is not supported.
Always specify a row subscript and a variable subscript, as in t(rows,vars).

採用された回答

Simon Chan
Simon Chan 2022 年 3 月 10 日
Try the following:
writetable(Dot1.Stats, 'sq_Dot1.csv','WriteMode','Append');
  1 件のコメント
Tomaszzz
Tomaszzz 2022 年 3 月 10 日
Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by