How to reshape matrix in this way?
Mostra commenti meno recenti
Hello everyone,
I was wondering if anyone could help me in a simple question in matrix reshaping.
I have a 3x4 matriz M, as it follows:
M = [1 2 3 4;
5 6 7 8;
9 10 11 12]
I would like to reshape M to have the following matrix N:
N = [1 2;
3 4;
5 6;
7 8;
9 10;
11 12]
I have tried 'reshape' command, but failed. Can anyone please help?
Thanks in advance!
Risposta accettata
Più risposte (1)
BN
il 12 Mag 2020
Hello, Try this:
Answer = reshape(M.',2,[]).';
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!