wangxiaocvpr

%% Rank the entropy_loss     
% for iiii = 1:size(Group_age, 1)  
%     count_1 = 0 ;
%     tmp = Group_age(iiii, 1);
%     for jjj = 1:size(Group_age, 1)
%         if (Group_age(jjj, 1) > tmp)
%             count_1 = count_1 + 1;
%         else
%             continue;
%         end
%     end
%     Rank_age(iiii, 1) = count_1 + 1;    
% end

返回的序号绝逼是错误的额。。为何?

利用 matlab sort 函数,就可以了,如:

 

>> X = [3 7 5 0 4 2 ];
>> [y, index] = sort(X)

y =

     0     2     3     4     5     7


index =

     4     6     1     5     3     2

 

分类:

技术点:

相关文章:

  • 2021-11-06
  • 2021-11-22
  • 2022-02-22
  • 2021-10-21
  • 2021-10-07
  • 2021-06-18
  • 2021-08-08
  • 2021-05-12
猜你喜欢
  • 2021-11-09
  • 2021-04-03
  • 2022-02-09
  • 2021-12-18
  • 2021-04-30
  • 2022-02-09
  • 2021-11-05
相关资源
相似解决方案