Monday 2 September 2013

Iterative Method Code

clc
clear all
x=1;
i=0;
t=0.00009;
while(1)
    fx=(cos(x)+1)/3;
    f=abs(x-fx);
    if(f<=t)
        x,i
    break;
    else
        x,i
        x=f;
    end
    i=i+1;
end

No comments:

Post a Comment