How to rank data in a whole matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I need to rank the data in a matrix but tiderank function does it for each column separately. how can I do it for all data in all rows and columns together? in a way that first cell of first column is first rank and last cell of last column is last rank.
Thank you
댓글 수: 0
채택된 답변
the cyclist
2012년 12월 19일
If A is your matrix, then
>> reshape(sort(A(:)),size(A))
should do it. You can use the 'descend' argument to the sort function if you wanted largest to smallest.
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!