[m,n]=size(y);
y1 = reshape(y,1,[]);
y2 = sort(y1,'descend');
y3 = reshape(y2,m,n); %把矩阵y的元素按照从大到小排列
A=reshape(sort(reshape(abs(y),1,[]),'descend'),3,3) %3*3的矩阵排序
版权声明:本文为meng4411yu原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
[m,n]=size(y);
y1 = reshape(y,1,[]);
y2 = sort(y1,'descend');
y3 = reshape(y2,m,n); %把矩阵y的元素按照从大到小排列
A=reshape(sort(reshape(abs(y),1,[]),'descend'),3,3) %3*3的矩阵排序