Export cell array xlswrite
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ali N
le 21 Jan 2020
Réponse apportée : Jakob B. Nielsen
le 21 Jan 2020
Hello all
I have cell arrey, each cell has a different dimention. I just want to Exports these cells one after another in a Excel file. Is there anyway to do that witha single line code or a loop. I can not do this with a single xlswrite.
Thanks
0 commentaires
Réponse acceptée
Jakob B. Nielsen
le 21 Jan 2020
Looping is the way to go. Depending on the dimensions of your cell you need to modify this, but for an example cell array named X with 2 cells, the first a 1x4 and the next a 1x7;
for i=1:size(X,2)
range=strcat('A',num2str(i),':A',num2str(i)); %write from excel cell A1 on the first run, A2 next run etc.
xlswrite(X{i,1},)
end
If some cells in your cell array are 2D, you will need to adjust accordingly. Note for this specific example your cells need to be rows - if they are columns, simply put a ' next to it.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!