How to update a variable in a function after every 5 seconds?

5 visualizaciones (últimos 30 días)
Omkar Jadhav
Omkar Jadhav el 7 de Abr. de 2020
Respondida: Birdman el 7 de Abr. de 2020
I have some variable 'x' which is changing continuously in the backgroud simulation. I want to store the value of x in variable "y" after every 5 seconds.
How do I do it?

Respuestas (1)

Birdman
Birdman el 7 de Abr. de 2020
Run the attached model and see the results. You can change the Ramp block's Slope value and store different numbers. Output of the MATLAB Function block stores dynamically the values at every 5 seconds.

Categorías

Más información sobre Unit Conversions en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by