3D Matrix (n*m*p) in Table

조회 수: 1 (최근 30일)
Hayfa R
Hayfa R 2019년 3월 31일
답변: Hayfa R 2019년 4월 1일
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
dpb
dpb 2019년 3월 31일
편집: dpb 2019년 3월 31일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Akira Agata
Akira Agata 2019년 4월 1일
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

추가 답변 (2개)

Hayfa R
Hayfa R 2019년 4월 1일
It worked well! thank you!

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by