% demonstracni priklad pro predvedeni newtonovy metody
% sepsal Jan Nejedly 2003
%
% ukazka bude provedena na f(x)=(x/2)^2-sin(x)


a=1.4
b=2.3
kroku=200
presnost=.001;
start=1;



x=start
for i=1:kroku
  fx=(exp(x)-sin(3*x))/(cos(5*x));
  dfx=(exp(x)-3*cos(3*x))/cos(5*x)-5*sin(5*x)/cos(5*x)^2*(exp(x)-sin(3*x));

  new=x-fx/dfx
  if abs(x-new)<presnost
    disp('mame nulu');
    x=new
    i
    break;
  end;
  x=new;

end;     	
