how to stack 2 dimensional arrays into 3 dimensional aarays?

조회 수: 90 (최근 30일)
Hassan Ashraf
Hassan Ashraf 2019년 8월 28일
답변: Bruno Luong 2019년 8월 28일
I have Nine(9) , 2-D arrays of size 3200x8.
I want to stack them into a 3D array so that I could have a final aaray of size 3200x8x9.
Please help!
  댓글 수: 2
Hassan Ashraf
Hassan Ashraf 2019년 8월 28일
Concatenating arrays does not change dimenions it only concatenates arrays and matrices

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

채택된 답변

Bruno Luong
Bruno Luong 2019년 8월 28일
If 2D arrays are stored in 9 variables
cat(3,A1,A2,A3,A4,A5,A6,A7,A8,A9);
If they are stored in 1x9 cell C
cat(3, C{:});

추가 답변 (1개)

darova
darova 2019년 8월 28일
Use cat()
  댓글 수: 4
Hassan Ashraf
Hassan Ashraf 2019년 8월 28일
I have Nine, 2D arrays of dimesnions 3200x8, and I want them to change a single 3D array of size 3200x8x9.
Stephen23
Stephen23 2019년 8월 28일
편집: Stephen23 2019년 8월 28일
"I have Nine, 2D arrays of dimesnions 3200x8, and I want them to change a single 3D array of size 3200x8x9."
Sure, use cat.

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

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by