converting 2d matrix to 3d
Ältere Kommentare anzeigen
Can anyone help me with making a 2D matrix into a 3D matrix?
I have a (71680 x 8) 2d matrix and I need to make a 3D matrix of dimensions (512 x 8 x 140) I need to take (512 x 8) consecutive matrices by row for 140 layers.
Can anyone help me with this? I really appreciate any help
Akzeptierte Antwort
Weitere Antworten (1)
amit
am 3 Okt. 2016
0 Stimmen
permute(reshape(X, 512, 140, 8), [1 3 2]); what is [1 3 2] stands for?
1 Kommentar
Walter Roberson
am 4 Okt. 2016
"B = permute(A,order) rearranges the dimensions of A so that they are in the order specified by the vector order"
In your case it would rearrange reshape(X, 512, 140, 8) to be 512 x 8 x 140 by rearranging the elements. What was previously indexed at location (I,J,K) would be at location (I,K,J) in the new array.
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!