creating 2D matrid from 3D matrix

3 Ansichten (letzte 30 Tage)
Bibek
Bibek am 22 Dez. 2011
I have a matrix F of size 201*3*201. I want to create another matrix Z of size 40401*3. I can do this as: Z=[F(:,:,1);F(:,:,2);......F(:,:,201)]; But how can I do this more quickly using loop or by any other tricks?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 22 Dez. 2011
Z = reshape( permute(F, [1 3 2]), [], 3);
  1 Kommentar
Bibek
Bibek am 23 Dez. 2011
Thanks for your input. It worked for me exactly in the way I wish

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by