function R = Euler11(f,a,b,ya,M) % - Solve by Euler method y'=f(t,y) with y(a)=ya % - t is in [a,b] .there are(M+1) equal sub-divisions. % - example R=Euler11('f88',b,ya,M) % - f88.m is text file that reads function f=f88(t,y) % - f=(t-y)/2 ; % - return h=(b-a)/M; T=zeros(1,M+1); Y=zeros(1,M+1); Y(1)=ya; T=a:h:b; disp('h=');disp(h); for j=1:M Y(j+1)=Y(j)+h*feval(f,T(j),Y(j)); end R=[T', Y']; T=T'; Y=Y'; plot(T,Y); xlabel(' T '); ylabel(' Y '); title(' Eulers method'); return