Objective value until convergence

2 ビュー (過去 30 日間)
Chetan Fadnis
Chetan Fadnis 2021 年 9 月 1 日
コメント済み: Chetan Fadnis 2021 年 9 月 1 日
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.

採用された回答

Image Analyst
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
  1 件のコメント
Chetan Fadnis
Chetan Fadnis 2021 年 9 月 1 日
Thank you for your reply.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by