Reducing matrix dimension to a lower dimension
147 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MiauMiau
am 22 Dez. 2015
Kommentiert: MiauMiau
am 22 Dez. 2015
Hi all,
I have a 1 x 400 x 16 matrix (400 measurements, 16 times). I would like to end up simply with a 400 x 16 matrix. Though when I use
reshape(X, [400,16])
it seems that the 400 rows do not correspond to the 400 measurements of one iteration, but that the data is all mixed up. How can I get the dimension I want?
Thanks
2 Kommentare
Renato Agurto
am 22 Dez. 2015
Your commad semms to be right. Maybe is the way you are looking at the 1x400x16 matrix.
display(X)
Matlab will show 16 arrays horizontally, which may make you think that the matrix is transposed.
what is the result of size(X)? it is really [1 400 16] ?
Akzeptierte Antwort
Ingrid
am 22 Dez. 2015
it looks like it is the squeeze command that you are looking for? Have you tried this:
squeeze(X);
Weitere Antworten (0)
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!