Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#5 |
初级会员
注册日期: 2009-04-24
帖子: 3
声望力: 0 ![]() |
![]()
ok啦
![]() function sort_a_matrix clear clc X=rand(4,5) [m,n]=size(X); max_number=10; max_value=sort(reshape(X,1,m*n),'descend') max_value=max_value(1:max_number) % max_site(m,n)=zeros for i=1:max_number [r(i),c(i)]=find(X==max_value(i)); end |
![]() |
![]() |