How can I change this 3-D array(2000,21,80) to 4-D array(1000,20,21,80)?

조회 수: 1 (최근 30일)
楠 赵
楠 赵 2020년 12월 25일
댓글: Walter Roberson 2020년 12월 25일
Hi,all !How can I change one 3-D array(2000,21,80) to 4-D array(1000,20,21,80)?

답변 (1개)

the cyclist
the cyclist 2020년 12월 25일
편집: the cyclist 2020년 12월 25일
Did you mean (1000,2,21,80)? If so, then you can use the reshape command:
output = reshape(x,[1000,2,21,80]);
where x is your input array.
If that is not what you meant, then you'll need to explain how you want to generate the greater number of elements in the output array.
  댓글 수: 3
the cyclist
the cyclist 2020년 12월 25일
You didn't give any information about how you wanted the elements from the input array arranged in the output array. We can't suggest how to do what you want, if you don't tell us.
Walter Roberson
Walter Roberson 2020년 12월 25일
reshape never changes the order in memory. A column of 2000 would reshape to two adjacent rows of 1000, first 1000 elements of the column then the second 1000.

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

카테고리

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