필터 지우기
필터 지우기

how can plot error with number of iteration?

조회 수: 2 (최근 30일)
Mary Jon
Mary Jon 2013년 11월 14일
댓글: Azzi Abdelmalek 2013년 11월 15일
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
Azzi Abdelmalek
Azzi Abdelmalek 2013년 11월 14일
This is not clear
Mary Jon
Mary Jon 2013년 11월 14일
if I have 120 iteration ,how can plot its
this code of error ,
[i j]=ndgrid(1:111,1:33);
G=(sum(sum((abs(v_now-v_prev)))));
MPD=G/(m*n); %error stoping criteria
while(MPD>0.00001); %Run this until convergence

댓글을 달려면 로그인하십시오.

답변 (1개)

Azzi Abdelmalek
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
Mary Jon
Mary Jon 2013년 11월 15일
iter=0;
[i j]=ndgrid(1:111,1:33);
MPD=1;
G=(sum(sum((abs(v_now-v_prev)))));
MPD=G/(m*n); %error stoping criteria
while(MPD>0.00001); %Run this until convergence
iter=iter+1; % Iteration counter increment
hold on
plot(MPD,iter)
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%end of code %%%%%%%%%%%%
Azzi Abdelmalek
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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by