필터 지우기
필터 지우기

3D hypercube to 2D array

조회 수: 4 (최근 30일)
KF
KF 2020년 12월 9일
댓글: Ameer Hamza 2020년 12월 9일
Hi,
I have a 3D hypercube of dimensions 250x250x150 and I am looking to make it 2D, expanding left to right along the 250x250 array to create a new array that is 62500x150. Would reshape(A,62500,150) work? I would essentially like my z-coordinate to become my y, and the x and y to become x.
Thanks in advance.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 12월 9일
편집: Ameer Hamza 2020년 12월 9일
No, If you want to read the elements left to right then first you need to permute the 1st and 2nd dimensions
A; % 250x250x150
B = reshape(permute(A,[2 1 3]), [], 150);
  댓글 수: 4
KF
KF 2020년 12월 9일
Does
C = permute(reshape(B,250,250,150),[2 1 3])
work?
Ameer Hamza
Ameer Hamza 2020년 12월 9일
Yes, thats correct.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by