 function Euler
 
	%initialiization of basic parameters
	x0=0; y0=1; b=5;
	h1=0.1; h2=0.01 ; h3=0.001;
 
	%initialization of the arrays
	x1=[];y1=[];
	x1(1)=x0;y1(1)=y0;
	
	x2=[];y2=[];
	x2(1)=x0;y2(1)=y0;
	
	x=3[]; y3=[]; 
	x3(1)=x0; y3(1)=y0;
	
	N=(b-x0);
    
	%filling the arrays
	for m=1:(N/h1)
		x1(m+1)=x0+m*h1;
		y1(m+1)=y1(m)+ff(x1(m),y1(m))*h1;
	end
    
	N=(b-x0);
    for k=1:(N/h2)
        x2(k+1)=x0+k*h2;
        y2(k+1)=y2(k)+ff(x2(k),y2(k))*h2;
    end
    
	N=(b-x0);
	for j=1:(N/h3)
		x3(j+1)=x0+j*h3;
		y3(j+1)=y3(j)+ff(x3(j),y3(j))*h3;
    end
    
    % defining our function
	function z=ff(x,y)
		z=y-x^2;
	end
 
	%drawing the solutions
	plot(x1,y1,'g',x2,y2,'k',x3,y3,'r')
	axis([0, 2, 1, 20]);
 
end



