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 日

4 投票

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

3 件のコメント

Trig
Trig 2013 年 5 月 14 日
PERFECT! thanks.
Matthias Heinlein
Matthias Heinlein 2022 年 7 月 12 日
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

2 件のコメント

ROHIT RAMTEKE
ROHIT RAMTEKE 2018 年 3 月 24 日
Thanks a lot Sir....
Ed Joz
Ed Joz 2018 年 6 月 9 日
This helped .. thank you sir

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeModeling についてさらに検索

質問済み:

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