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

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 get the value of n
i dont want the value of y
please show me the answer dont tell me how to do it this is new on me  this code on matlab the main equation is dy/dt = y+t

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!