how to export cell array to excel

6 vues (au cours des 30 derniers jours)
Davide Bertelli
Davide Bertelli le 15 Déc 2020
Commenté : KALYAN ACHARJYA le 15 Déc 2020
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 commentaire
KALYAN ACHARJYA
KALYAN ACHARJYA le 15 Déc 2020
Within the cell elements?

Connectez-vous pour commenter.

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 15 Déc 2020
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 commentaires
Davide Bertelli
Davide Bertelli le 15 Déc 2020
Thank You very much!!!
It works!!
davide
KALYAN ACHARJYA
KALYAN ACHARJYA le 15 Déc 2020
Its my pleasure :)

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by