Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Sort every sixth column

1 回表示 (過去 30 日間)
Eivind Jamessen
Eivind Jamessen 2020 年 4 月 7 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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

回答 (1 件)

Matt J
Matt J 2020 年 4 月 7 日
編集済み: Matt J 2020 年 4 月 7 日
matrix(:,1:6:end)=sort(matrix(:,1:6:end))
  2 件のコメント
Eivind Jamessen
Eivind Jamessen 2020 年 4 月 7 日
Thanks, it almost worked.
but i get this: Subscripted assignment dimension mismatch.
I can't see why...
Matt J
Matt J 2020 年 4 月 7 日
Try now.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by