How to find the iteration number which gave me specific result?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Sean de Wolski
2014-11-25
Store the iteration number as well as the minimum.
Or just use min with two outputs
[minv, idx] = min(A)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!