t1 = 0; %initial condition y(t1) = y1 y1 = 1; %initial condition h = .01; %step size tend = 10; %end time t = t1:h:10; %vector of time points N = length(t); y = zeros(1,N); %creates a vector of length N of zeroes y(1) = y1; %apply initial condition for i=2:N s = myf(t(i-1),y(i-1)); y(i) = y(i-1) + h*s; end %plot the results plot(t,y,'color','red'); %set the font size xlabel('t','fontsize',15); ylabel('y','fontsize',15); set(gca,'fontsize',15);