tout (time) is not working

28 ビュー (過去 30 日間)
Ayoub Bouhal
Ayoub Bouhal 2020 年 5 月 30 日
コメント済み: Ameer Hamza 2020 年 6 月 2 日
so while i was using simulink to try to modelise a signal schematic and when i use the gain component and try to put this expression tout(length(tout)) in the gain expression i get the following error 'Variable 'tout' does not exist.' , well i m not an expert on matlab so if you guys can help it would be much appreciated

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 5 月 30 日
tout is only created after the simulation is complete. Therefore, you cannot use it as an input to gain. It seems that you want to find out the stop time of the simulation. If yes, then you can use the following command in the gain block.
str2num(get_param(bdroot, 'StopTime'))
  2 件のコメント
Ayoub Bouhal
Ayoub Bouhal 2020 年 6 月 1 日
yeah , now seems to work just fine thanks a lot for the help
Ameer Hamza
Ameer Hamza 2020 年 6 月 2 日
I am glad to be of help!

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

カテゴリ

Help Center および File ExchangeString についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by