
%KOKBUL Summary of this function goes here
%   Detailed explanation goes here
clc
clear
deltax=0.001;
x=-50:deltax:100;
y=(x-1).^2-20;

%deger_index=120;
deger=5;%x(deger_index);
k=1;
while(abs((deger-1).^2-20)>0.001)
%for k=1:15
    hata=((deger-1).^2-20)
    deger
     cizdir(k)=deger;
    k=k+1;
    deger_index=ceil((deger+5)/deltax)
    egim=(y(deger_index+1)-y(deger_index))/deltax;
    deger=deger-sign(y(deger_index))*y(deger_index)/egim;
   
    
end
k 
hata=((deger-1).^2-20) 

deger

stem(cizdir)


