Exporting a pre-allocated cell array to .csv files

1 回表示 (過去 30 日間)
Dee
Dee 2019 年 1 月 21 日
コメント済み: Dee 2019 年 1 月 21 日
I have a 961X1 pre-allocated cell array. Each variable in this cell array is another array of 64X362 numbers. I need to export each of the 961 variables into separate .csv files. I have tried writetable/ csvwrite, but that simply converts it into another pre-allocated table. How do I call each of the 961 variables into a separate .csv file?
The reason I want each of the 961 variables into separate .csv files is because I will use another program, 'ImageJ' to further process these files. Capture.PNG

採用された回答

per isakson
per isakson 2019 年 1 月 21 日
編集済み: per isakson 2019 年 1 月 21 日
I cannot guess what you tried and failed. However, study this example
%%
M961x1 = repmat( {magic(5)}, 3,1 ); % Small set of sample data
folder = 'h:\m\cssm';
for jj = 1 : size( M961x1, 1 )
ffs = fullfile( folder, sprintf('pipe_%03d.csv',jj) );
csvwrite( ffs, M961x1{jj} )
end
  1 件のコメント
Dee
Dee 2019 年 1 月 21 日
Thank you!!! It worked so well!!!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by