Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Sort every sixth column

2 visualizzazioni (ultimi 30 giorni)
Eivind Jamessen
Eivind Jamessen il 7 Apr 2020
Chiuso: MATLAB Answer Bot il 20 Ago 2021
Hi
I have a big matrix (5X30), and i want to sort every sixth column in ascneding order.
I have tried to use sortrow(matrix,column) in a foor loop, but the problem is that the command only sort the last column in the for loop. It does not save alle the sort columns.
Any advice for this?
Thanks

Risposte (1)

Matt J
Matt J il 7 Apr 2020
Modificato: Matt J il 7 Apr 2020
matrix(:,1:6:end)=sort(matrix(:,1:6:end))
  2 Commenti
Eivind Jamessen
Eivind Jamessen il 7 Apr 2020
Thanks, it almost worked.
but i get this: Subscripted assignment dimension mismatch.
I can't see why...
Matt J
Matt J il 7 Apr 2020
Try now.

Questa domanda è chiusa.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by