在一组数据中,如何将数据从大到小进行排序?使用sort数据变得从小到大:
a=[1 3 5 2 6];
b=sort(a);
b=[1 2 3 5 6];但我想要b:
b=[6 5 3 2 1]发布于 2014-02-14 12:27:39
检查http://www.mathworks.com/help/matlab/ref/sort.html。排序函数可以接受模式参数。
b = sort(a) % 'ascend' by default
b = sort(a, 'descend') % sort data from large to small发布于 2014-02-14 12:34:39
https://stackoverflow.com/questions/21779334
复制相似问题