3D hypercube to 2D array

6 Ansichten (letzte 30 Tage)
KF
KF am 9 Dez. 2020
Kommentiert: Ameer Hamza am 9 Dez. 2020
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.

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 9 Dez. 2020
Bearbeitet: Ameer Hamza am 9 Dez. 2020
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 Kommentare
KF
KF am 9 Dez. 2020
Does
C = permute(reshape(B,250,250,150),[2 1 3])
work?
Ameer Hamza
Ameer Hamza am 9 Dez. 2020
Yes, thats correct.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by