Storing value in simulink

14 ビュー (過去 30 日間)
Hariharan MK
Hariharan MK 2020 年 6 月 18 日
回答済み: Ameer Hamza 2020 年 6 月 18 日
Is it possible to store a value in simulink? Let's say i have a sine wave and a ramp function, i want to store the value of the sine function at the exact moment the ramp function reaches the value 1
when the sine wave reaches back to the same value, i want an action to trigger each time the sine function reaches this value. Is this possible in simulink? If so how do i go about doing it?
For example, when the ramp function reaches the value of 1,
the value of the sine function is -0.05
so whenever the sine function reaches this value i want to trigger a switch block to perform a certain action.

採用された回答

Nikhil Reddy Pottanigari
Nikhil Reddy Pottanigari 2020 年 6 月 18 日
We can store values in Simulink. But, Not at runtime. Once a simulation is done we can store the values of that simulation in workspace and use them for next simulation.
Refer to this link for better understanding:
But in your case, you can do like this:
Use compare to constant and switch block to store the value of sine, at point where value of ramp is equal to specific value, in your case 1. Then you can use compare and trigger the switch. You can refer to attachment I attach for better understanding.
  1 件のコメント
Hariharan MK
Hariharan MK 2020 年 6 月 18 日
Thanks for your help!

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

その他の回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 6 月 18 日

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by