function [X,Y] = euler1(x,xf,y,n) h = (xf - x)/n; % step size X = x; % initial x Y = y; % initial y
for i = 1 : n % begin loop y = y + h*f(x,y); % Euler iteration x = x + h; % new x X = [X;x]; % update x-column Y = [Y;y]; % update y-column end % end loop
This is what i 've done but i don't know if it's correct. I would appreciate it if you tell me if everything is ok.
No products are associated with this question.
Play games and win prizes!Learn more