フィルターのクリア

How to update a signal in Simulink

10 ビュー (過去 30 日間)
Nishant Kumar
Nishant Kumar 2020 年 3 月 30 日
コメント済み: Nishant Kumar 2020 年 3 月 31 日
I essentially need to do 'x = x + a*b' operation at every time-step in my simulation. The value of b is changing throughout the simulation and the value of x is given initially. I tried using 'memory' block for the same but wasn't able to get the desired result due to sample time mis-match. The values are getting updated every 0.2 seconds whereas the step-time is 1s.
Please suggest what blocks I should use; if possible a diagram too. I think I need a block which can act as a source but also have an option to be updated. Or any other way to carry out the above task would suffice.
I have done this in Matlab script and it was very easy there, but I need a Simulink model solution.

採用された回答

Fangjun Jiang
Fangjun Jiang 2020 年 3 月 30 日
The true meaning of the equation is x=previous_x+a*b. Use the "Delay One Step" block (also called z-delay, unit delay, 1/z). The input is x, the output is previous_x, then construct your model.
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2020 年 3 月 31 日
You can specify the initial value for the z-delay block. It "gets updated everytime" when the simulation is run.
Nishant Kumar
Nishant Kumar 2020 年 3 月 31 日
Thanks a lot for help. This worked out fine for me.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by