How to determine the index of two smallest probability in a vector
1 次查看(过去 30 天)
显示 更早的评论
I have a vector A
A=[0.7188 0.0625 0.0625 0.0469 0.0313 0.0156 0.0156 0.0156 0.0156 0.0156]
How can I find the two smallest probabilities and result only the index .The result will be :-
b=[9 10]
0 个评论
采纳的回答
madhan ravi
2018-11-19
编辑:madhan ravi
2018-11-19
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)
7 个评论
madhan ravi
2018-11-19
Asking in the forum is better , if you have a question post a separate question .
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!