Effacer les filtres
Effacer les filtres

How to sort new vector of the result of sum smallest probability?

1 vue (au cours des 30 derniers jours)
fyza affandi
fyza affandi le 19 Nov 2018
I have matrix A with 10 probabilities. Then, I get the smallest probability index which is 9 and 10
A=[0.7188 0.0625 0.0625 0.0469 0.0313 0.0156 0.0156 0.0156 0.0156 0.0156]
index = find(ismember(A,min(A)));
B = index(end-1:end); % sucessfully run
After that I need to add the two smallest probabilities and named as C1 and delete the two smallest probability.
C1= A(9) + A(8); %C1= 0.0312
Then I need to sort the probability again in descending order.
A=[0.7188 0.0625 0.0625 0.0469 0.0313 C1 0.0156 0.0156 0.0156 ]

Réponse acceptée

madhan ravi
madhan ravi le 19 Nov 2018
sort(A,'descend') %at the end

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by