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

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.

 Respuesta aceptada

See
To read the current simulation time of model from matlab, use
get_param('YourModel','SimulationTime')

3 comentarios

PERFECT! thanks.
Is there an overview of Matlab where I can find the names for similar model variables like 'SimulationTime'?
Piotr Kluczek
Piotr Kluczek el 15 de Jul. de 2022
Editada: Piotr Kluczek el 15 de Jul. de 2022
You can use this command to see for the selected block:
fieldnames(get_param(gcb,'ObjectParameters'))

Iniciar sesión para comentar.

Más respuestas (2)

Azzi Abdelmalek
Azzi Abdelmalek el 3 de En. de 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 comentarios

Thanks a lot Sir....
This helped .. thank you sir

Iniciar sesión para comentar.

Categorías

Más información sobre Modeling en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 3 de En. de 2013

Editada:

el 15 de Jul. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by