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!