export to excel

2 Ansichten (letzte 30 Tage)
Hassan
Hassan am 17 Feb. 2012
I have an array(18 rows, 30 columns, 4 layers) and I want to export it to excel as array(:,:,1) would be written to coulmn 1,array(:,:,2) to coulmn2,array(:,:,3) to coulmn3,array(:,:,4) to coulmn4. Could you please tell me how I can do that?

Akzeptierte Antwort

Sarah Wait Zaranek
Sarah Wait Zaranek am 17 Feb. 2012
This should work out for you. Reshape the array so it is an nx*ny by 4 and then use the xlswrite command.
A = rand(18,30,4);
Areshape = reshape(A,[18*30 4]);
xlswrite('MyTestFile.xlsx',Areshape)
  1 Kommentar
Hassan
Hassan am 17 Feb. 2012
Thanks Sarah.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by