Using simulation time as an input in other simulink blocks
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
We are trying to use the runtime in Simulink as an variable for further use in other blocks.
Simulation runs at t=0, and at some point in the simulation it will reach a block X.
We want to use the simulation time at that point to get a value from a vector.
E.g.
At event action "2" at t=100, it will get a number from a vector.
statetime = states(t);
dt = 1000 + statetime;
The entity will go through several blocks where it will need to use the simulation time again.
simulation.tout will give us the number, but it requires that the simulation has already run?
1 Commento
Renato SL
il 31 Ott 2019
You mentioned 'entity', so I assume you use SimEvents?
Take a look at the Common Design Patterns (documentation here), specifically the patterns time stamp entities upon generation. If assigning the simulation time to the entities could be interesting for you, then the example should be useful.
Risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!