Export cell array xlswrite
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Ali N
el 21 de En. de 2020
Respondida: Jakob B. Nielsen
el 21 de En. de 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 comentarios
Respuesta aceptada
Jakob B. Nielsen
el 21 de En. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!