In SIMULINK, how can I get the time corresponding to my particular output of of a function block?

1 回表示 (過去 30 日間)
For example I have my function y=f(t) and I want to assign the time corresponding to y=k, to T1. k is const.

採用された回答

Sebastian Castro
Sebastian Castro 2017 年 7 月 24 日
I would use a Triggered Subsystem to do this. The subsystem would be driven by a rising edge in the comparison y=k, so that when this becomes true, the subsystem executes.
Inside the Subsystem, you could put in a "Clock" block so when the subsystem executes, the time is output.
One other note, you may want to do the comparison either with some tolerance or as a "greater than or equal", so you don't miss the event.
- Sebastian
  2 件のコメント
Santhosh Naidu
Santhosh Naidu 2017 年 7 月 25 日
I am not able to implement it, can you please illustrate with an example
Sebastian Castro
Sebastian Castro 2017 年 7 月 25 日
Sure -- it would look as below.
The contents of the Triggered Subsystem are literally just passing the input right through the output. Essentially, it "grabs" the clock value when the trigger event occurs.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by