How shall I sort along a dimension?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a three dimensional array where the first dimension is month the second dimension is city, and the third dimension is temperature of days in that month. I want to sort so thta the array will have, for each month, for each city, the temperature of the day in the descending order. How shall I sort?
댓글 수: 0
채택된 답변
Rik
2022년 7월 15일
The sidebar showed this thread to me. It probably showed you a similar one before you posted this question.
The solution is similar: use the second and third input of the sort function:
sorted_data=sort(data,3,'descend')
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!