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!