필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Sort every sixth column

조회 수: 2 (최근 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