how to export cell array to excel

5 ビュー (過去 30 日間)
Davide Bertelli
Davide Bertelli 2020 年 12 月 15 日
コメント済み: KALYAN ACHARJYA 2020 年 12 月 15 日
My code generates a cell array with five (5x5) num cells and now I need to export it in a way that each cell of the array will be written in a different sheet of an excel file.
Actually if I use xlswrite, an empty xls file is generated.
I apologize for the silly question but I am a new matlab user and I have not found any useful information in the community
Thanks in advance
Davide
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 12 月 15 日
Within the cell elements?

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

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 12 月 15 日
Lets say "cell_data" is cell array
[r c]=size(cell_data);
sheet_num=1;
for i=1:r
for j=1:c
data=cell_data{i,j};
xlswrite('cell_data.xlsx',data,['Sheet',num2str(sheet_num)]);
sheet_num=sheet_num+1;
end
end
  2 件のコメント
Davide Bertelli
Davide Bertelli 2020 年 12 月 15 日
Thank You very much!!!
It works!!
davide
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 12 月 15 日
Its my pleasure :)

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by