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

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by