Question: this code on matlab the main equation is dy/dt = y+t , y(0)=1, n=3 the code is working but i need to add step to
d.m* x + in mmm function Euler(n) to=0; % Initial time tn=10; % Final time N=3; % Number of time steps h=(tn-to)/N; % Time step t = zeros (N,1); y(1) = 1 ; % initial value of y is zero % For loop, sets next t,y values for n=1:N t(n+1)=t(n) +h; y.(n+1)=y(n) +h*f(t(n),y(n)); % Calls the function f(t,y)=dy/dt end plot(t,y) end % Include your own name %%equation function f - f(t,y) f - (y+t) : end in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
