Update and Outouts in S function

1 回表示 (過去 30 日間)
Owen
Owen 2012 年 10 月 17 日
Hi,
I try to understand the methods Update and Outputs in S function. Please tell me if my understanding is correct. Thank you.
1. They are executed only once at every sample time.
2. They are executed at the very same time but the purposes of both are different. In Update “block.Dwork(1).Data” is actuated. In Outputs “block.OutputPort(1).Data” is actuated.
Best Regards, Senmeis

採用された回答

Kaustubha Govind
Kaustubha Govind 2012 年 10 月 17 日
  1. Yes, this is true in general. However, I believe the Outputs function may be called more than once if the S-function has continuous states or zero crossings. See the "Simulation Loop" flowchart on this page.
  2. Outputs is always called right before Update as the above flowchart depicts. And yes, Update is used to update states inside the block, whereas Output is used to actually compute and write to the outputs.

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by