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 commentaire

dpb
dpb le 31 Mar 2019
Modifié(e) : dpb le 31 Mar 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.

Connectez-vous pour commenter.

 Réponse acceptée

Akira Agata
Akira Agata le 1 Avr 2019

0 votes

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

Plus de réponses (2)

Hayfa R
Hayfa R le 1 Avr 2019

0 votes

It worked well! thank you!

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by