How to find the iteration number which gave me specific result?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Abhinav
am 25 Nov. 2014
Beantwortet: Sean de Wolski
am 25 Nov. 2014
Say I am generating an array in matlab using for loop. In that array I have to find which value is minimum, so I used min function to find out. No I want to find out which iteration gave that result. How can I achieve this?
0 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 25 Nov. 2014
Store the iteration number as well as the minimum.
Or just use min with two outputs
[minv, idx] = min(A)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements 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!