% ex_fix_point
% PURPOSE
% Make iteration scheme for solving non-linear equation
% f(x)=x-sin(x)+1/2 = 0

x=-2;
f=1;
i=1;
while abs(f) > sqrt(eps)
    i=i+1;
    x=sin(x)-0.5;
    f=x-sin(x)+0.5;
end
i  % number of iterations
x  % the solution
f  % f(x) should be 