Reshape array 3 variables into 2?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Auryn_
am 30 Jan. 2018
Bearbeitet: Andrei Bobrov
am 30 Jan. 2018
Hi,
I have an array of A=1x100x50.
How can I reshape it in B=100x50?
I have tried with
B=reshape(A,[100, 50]);
But I get the error message
Error using reshape To RESHAPE the number of elements must not change.
Thanks in advance for your reply.
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 30 Jan. 2018
Bearbeitet: Andrei Bobrov
am 30 Jan. 2018
B = squeeze(A)
or
B = permute(A,[2,3,1]);
or
B = reshape(A,size(A,2),[]);
0 Kommentare
Weitere Antworten (1)
Abhishek Ballaney
am 30 Jan. 2018
https://in.mathworks.com/help/matlab/ref/reshape.html
0 Kommentare
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices 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!