フィルターのクリア

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

1 回表示 (過去 30 日間)
fyza affandi
fyza affandi 2018 年 11 月 19 日
回答済み: madhan ravi 2018 年 11 月 19 日
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 ]

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 19 日
sort(A,'descend') %at the end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by