Unfold 3D I x J x K to 2D I x JK
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi,
I am trying to unfold a matrix in the form I x J x K to I x JK corresponding to I batches, J variables and K time periods (within the batch).
I currently have got this matrix:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/232219/image.png)
And I need it in the form:
![batch wise unfold matrix.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/232220/batch%20wise%20unfold%20matrix.png)
How would I go about doing this as I think reshape is inadequate?
Thanks
댓글 수: 1
채택된 답변
KALYAN ACHARJYA
2019년 8월 1일
편집: KALYAN ACHARJYA
2019년 8월 1일
"I am trying to unfold a matrix in the form I x J x K to I x JK"
May be: Are you looking for this one?
[R C D]=size(M);
X=reshape(M,R,C*D)
I ignored this part "corresponding to I batches, J variables and K time periods (within the batch). "
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!