How to determine the index of two smallest probability in a vector
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
fyza affandi
am 19 Nov. 2018
Kommentiert: fyza affandi
am 19 Nov. 2018
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 Kommentare
Akzeptierte Antwort
madhan ravi
am 19 Nov. 2018
Bearbeitet: madhan ravi
am 19 Nov. 2018
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 Kommentare
madhan ravi
am 19 Nov. 2018
Asking in the forum is better , if you have a question post a separate question .
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!