Hello,
I m trying to convert a 3D matrix (n*m*p) in a p* excel sheets with an (n*m) Table in each sheet,
I tried to do it in a for loop but i cant create a 3D Table, and I cant change the variable inside the loop.
Can you please help me. thanks

1 Kommentar

dpb
dpb am 31 Mär. 2019
Bearbeitet: dpb am 31 Mär. 2019
Should be no problem at all...show us the code you tried and to ensure we're on the same page what the output from
whos X
where "X" is the variable name of your 3D array.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Akira Agata
Akira Agata am 1 Apr. 2019

0 Stimmen

How about the following?
% Sample data (n,m,p were assumed to be 20,10,5,respectively)
A = rand(20,10,5);
% Save as an Excel file
for kk = 1:size(A,3)
xlswrite('yourExcel.xlsx',A(:,:,kk),kk);
end

Weitere Antworten (2)

Hayfa R
Hayfa R am 1 Apr. 2019

0 Stimmen

It worked well! thank you!

Gefragt:

am 31 Mär. 2019

Beantwortet:

am 1 Apr. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by