how to update value of a function at each time step
Afficher commentaires plus anciens
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!!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!