How to get current time of simulation while Model is executing.

33 vues (au cours des 30 derniers jours)
Kumar Nikhil
Kumar Nikhil le 3 Jan 2013
Modifié(e) : Piotr Kluczek le 15 Juil 2022
I want to execute many test cases one by one. For this,I want to execute a test case after every 50 simulation seconds. For this I want to get simulation time data runtime. Thank you.

Réponse acceptée

TAB
TAB le 3 Jan 2013
See
To read the current simulation time of model from matlab, use
get_param('YourModel','SimulationTime')
  3 commentaires
Matthias Heinlein
Matthias Heinlein le 12 Juil 2022
Is there an overview of Matlab where I can find the names for similar model variables like 'SimulationTime'?
Piotr Kluczek
Piotr Kluczek le 15 Juil 2022
Modifié(e) : Piotr Kluczek le 15 Juil 2022
You can use this command to see for the selected block:
fieldnames(get_param(gcb,'ObjectParameters'))

Connectez-vous pour commenter.

Plus de réponses (2)

Azzi Abdelmalek
Azzi Abdelmalek le 3 Jan 2013
You can use a clock block from simulink/sources with math function block (set to mod) and a constant block.
every 50s the output will be set to 0
  2 commentaires
ROHIT RAMTEKE
ROHIT RAMTEKE le 24 Mar 2018
Thanks a lot Sir....
Ed Joz
Ed Joz le 9 Juin 2018
This helped .. thank you sir

Connectez-vous pour commenter.


Suneesh
Suneesh le 3 Jan 2013

Catégories

En savoir plus sur Modeling dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by