How to reshape/permute array correctly?
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sophie Mayne
am 15 Mai 2018
Beantwortet: James Tursa
am 15 Mai 2018
I cannot seem to apply the examples in the 'reshape' documentation and/or the answers given in this forum to this many dimensions.
I have an array of 1440x2x8x703x2 and wish to combine the 1440 and 703 dimensions so that I have: 1012320x2x8x2 instead. Should I use a loop or reshape/permute for this? If someone could explain how to use the latter, I would greatly appreciate it, as the documentation is rather confusing!
0 Kommentare
Akzeptierte Antwort
James Tursa
am 15 Mai 2018
E.g.,
x = your array
y = permute(x,[1 4 2 3 5]); % Or permute(x,[4 1 2 3 5]) depending on order that you want
result = reshape(y,1012320,2,8,2);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!