function [xx,yy]=ee_demo(f,x0,xn,y0,h,u)

x=x0;
y=y0;
xx=x0;
yy=y0;
while x<xn
    y=y+h*eval(f);
    x=x+h;
    xx=[xx,x];
    yy=[yy,y];
end
miny=min(yy);
maxy=max(yy);
% figure
hold on
plot(x0,y0,'r*');
axis([x0,xn,miny,maxy])
t1=title(['Explicitni Eulerova metoda, h=',num2str(h),', rovnice y=',f,]);
set(t1,'fontsize',16);
for k=2:length(xx)
    line([xx(k-1),xx(k)],[yy(k-1),yy(k)]);
    plot(xx(k),yy(k),'r*')
    pause(0.1)
end
if nargin==6
    pomx=linspace(x0,xn);
    x=pomx;
    pomy=eval(u);
    plot(pomx,pomy,'--g')
end