How to store value in simulink

253 ビュー (過去 30 日間)
prasanjit dey
prasanjit dey 2019 年 4 月 23 日
コメント済み: Gabriele Curcio 2022 年 5 月 6 日
Hello everyone I am desgning a model in which I need to store a value . For example: there is 2 inputs to the subsystem, input a & b .If a &b both are true, I calculate some values,say, x1 and x2. Now, next time when either a or b is false, I want to use those previously calcutaed values (i.e. when a & b were true). So, is there any way to store x1 and x2 in Simulink to use it later? Thanks in adcance.
  2 件のコメント
Aquatris
Aquatris 2019 年 4 月 23 日
You can use a "transport delay" block to store the value for the next time step (transport delay to delay the signal 1 time step so that the next time step you will have access to the signal from current time step) . Do you need to store the values for more than 1 time step?
Gabriele Curcio
Gabriele Curcio 2022 年 5 月 6 日
I have the same problem, but I need to store values for more than 1 time step. How it's possible to do it?
Thanks in advance

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

回答 (1 件)

Ben Cunningham
Ben Cunningham 2019 年 4 月 23 日
編集済み: Ben Cunningham 2019 年 4 月 23 日
There is a good blog entry covering this.
I'd recommend the 'Enabled Subsystem' approach (coincidently the author's favourite as well).
  1 件のコメント
Ben Cunningham
Ben Cunningham 2019 年 4 月 23 日
Alternately if you have the DSP System Toolbox the Sample and Hold block would be a neater but comparable solution.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by