Objective value until convergence
조회 수: 5 (최근 30일)
이전 댓글 표시
I am writing a code which repeat until the convergence is reached. What decides the convergence of a objective? And how to repeat the code? I am using while loop for it. Can anyone suggest me any other methods. Thanks.
댓글 수: 0
채택된 답변
Image Analyst
2021년 9월 1일
You decide it. Then just have a while loop where you get the "objective" as you call it. The loop will break once your "objective" is less than your tolerance/threshold:
loopCounter = 1;
maxIterations = 9999999; % Failsafe
objective = inf;
threshold = 10; % Whatever...
while loopCounter < maxIterations && objective > threshold
objective = GetNewObjective(); % However you do it....
loopCounter = loopCounter + 1;
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numeric Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!