Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Sorting a m x n matrix

1 vue (au cours des 30 derniers jours)
t4741
t4741 le 7 Sep 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
I have an M x N array for example ;
[1;2;3;4;5;6;7;8;9]
and i want to sort it into the format where the first three values become the first column,then 4 5 6 are the second column etc. So it will output
[1 4 7; 2 5 8; 3 6 9]
Is there a function that can do this, or how should I approach this?

Réponses (1)

madhan ravi
madhan ravi le 7 Sep 2019
reshape([1;2;3;4;5;6;7;8;9],3,[])

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by