using last result to start an iteration process and continously
古いコメントを表示
Please how do I make an answer gotten to repeat a process of two variables and then until its convergence. In other words, I don't know the number of iterations to be done.
回答 (1 件)
Guillaume
2015 年 2 月 17 日
I'm sorry to say that your question is not clear at all. It's obvious that English is not your native language.
condition = false;
while ~condition
condition = resultofsomeoperation();
end
2 件のコメント
bayoishola20
2015 年 2 月 18 日
Guillaume
2015 年 2 月 19 日
%initialise data
%... calculate A, f, etc.
x1 = 5, x2 = 4;
convergencethreshold = 1e-8; %or whatever you want
dx = [Inf Inf];
while any(abs(dx) > convergencethreshold)
A = [2*x1 - 6, 8*x2 - 32; 2*x1 - 8, 2*x2 - 20]
dx = inv(A'*A)*(A'*f)
x1 = x1 + dx;
x2 = x2 + dx;
end
カテゴリ
ヘルプ センター および File Exchange で Code Performance についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!