how can plot error with number of iteration?
2 ビュー (過去 30 日間)
古いコメントを表示
when used (while loop) as stopping condition of process ,we specified the value of error may be 0.001 or 0.00001
if I have number of iteration ,How can plot the error with iteration numbers?
2 件のコメント
回答 (1 件)
Azzi Abdelmalek
2013 年 11 月 14 日
[i j]=ndgrid(1:111,1:33);
MPD=1;
while(MPD>0.00001);
G=(sum(sum((abs(v_now-v_prev)))));
MPD=G/(m*n);
% your code
end
8 件のコメント
Azzi Abdelmalek
2013 年 11 月 15 日
You are not doing anything inside the loop. Try
iter=0;
MPD=1;
while(MPD>0.00001); %Run this until convergence
G=(sum(sum((abs(v_now-v_prev)))));
MPD=G/(m*n); %error stoping criteria
iter=iter+1; % Iteration counter increment
hold on
plot(iter,MPD)
end
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!