How to output a nested cell array data to .csv or .xls

16 ビュー (過去 30 日間)
micholeodon
micholeodon 2016 年 4 月 5 日
編集済み: Orion 2016 年 4 月 5 日
Hello,
I would like to ask, how I can output to a .csv or .xls a nested cell array of following form:
- main cell array is of type 1x152 cell
- every of 152 cell is a 1x6 cell of form { 'string', 'string', 'string', 'string', 'string', 1x4096 double}
Output file should consist of 152 lines.
Thanks in advance for help.

回答 (1 件)

Orion
Orion 2016 年 4 月 5 日
編集済み: Orion 2016 年 4 月 5 日
Hi,
you can't write this kind of variable in one time.
eventually, you can write it in a xls file using a for loop.
something like
for i = 1:length(mydata)
% write the ith component in the ith sheet
xlswrite('result.xlsx',mydata{i},['sheet_' num2str(i)]);
end
or you can write the first subcell between the columns A to F, then the second subcell between columns G to L, and so on....

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by