i want to check every row that which variable has higest probality ,with indix # of highest prob and arrange it descending order wtih orginal indices and convert it to text which tel me that e.g index 4 has high prob separated by ;
1 次查看(过去 30 天)
显示 更早的评论
clc
x=[A B];
value=0; index=0;
for k=1:5000;
[v in]=max(x(k,:));
value=[value v];
index=[index in];
end
value=value(:,2:end);
index=index(:,2:end);
%% Finding which index has maximum no of values
ma=find(index==1);
mb=find(index==2);
% s0 "ma" has maximum values = 3573
%% Sorting
[Sort_val val_Ind]=sort(value,'descend');
org_ind=0;
for k=1:5000;
sorted_indices=index(val_Ind(k));
org_ind=[org_ind sorted_indices];
end
org_ind=org_ind(:,2:end);
% dlmwrite('val_Ind.dat',val_Ind,'delimiter',';')
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!