how to update value of a function at each time step
Show older comments
Hi everyone, I am really stuck in creating a code that updates the value of my function K(t) at each time step and plots it. Seems quite simple but cant get my head around it.
at t=0 K(old)=3
at t=1 K(new_1)=K(old)+dt*dK/dt
at t=2 K(new_2)=K(new_1)+ dt*dK/dt
where dK/dt=4*exp(-30*(t - 3).^2)
for each subsequent time step we update the previous value with dK/dt
I would like to plot K(new) for t=0:0.01:10
Thanks!!
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!