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.

 채택된 답변

TAB
TAB 2013년 1월 3일
See
To read the current simulation time of model from matlab, use
get_param('YourModel','SimulationTime')

댓글 수: 3

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

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 1월 3일

5 개 추천

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

카테고리

도움말 센터File Exchange에서 Modeling에 대해 자세히 알아보기

질문:

2013년 1월 3일

편집:

2022년 7월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by