This preview shows page 1. Sign up to view the full content.
Unformatted text preview: h=(b-a)/N; % definding the step size. t=a; t(1)=t; % initial value of t and calculated value each step. y=alpha; y(1,:) = y'; % the initial and calculated value each step. y(1) = alpha; t(1) = a; % the main program. for i=1:N, f1 = h*feval(fofty,t,y); f2 = h*feval(fofty,t+h, y+f1); y = y+0.5*(f1+f2); t = t+h; end y(i+1,:)=y';...
View Full Document
This note was uploaded on 12/19/2010 for the course PHYS 5073 taught by Professor Mark during the Spring '10 term at Arkansas.
- Spring '10