swap x and y axis in a matrix
32 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Maryam Hamrahi
il 31 Mag 2016
Risposto: Jos (10584)
il 31 Mag 2016
I would like to swap x and y axis in a matrix with n rows and two columns.
I have [r1 r2] and I would like to convert it to [r2 r1]
Thanks in advance for any answers!
0 Commenti
Risposta accettata
Jos (10584)
il 31 Mag 2016
M = [1 10 ; 2 20 ; 3 30]
Mnew = M(:,[2 1]) % by far the easiest
New = fliplr(M)
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!