フィルターのクリア

How to pass a changing value from workspaces to Simulink?

1 回表示 (過去 30 日間)
Andrea Strappato
Andrea Strappato 2020 年 5 月 27 日
コメント済み: zahra hosaini 2021 年 9 月 7 日
Hi everyone,
I'm trying to pass a value from workspaces to Simulink calculated by Matlab step-by-step. This value changes each step, but the Simulink simulation take the first value and keep it costant. I'm using simin block and doesn't refresh data. How can I solve this issue?
  1 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 5 月 28 日
How is value changing in base workspace? Are you running a loop which changes the value of the variable?

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

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 5 月 28 日
編集済み: Ameer Hamza 2020 年 5 月 28 日
If the value is continually changing in the base workspace, you need to use MATLAB function block and evalin() to read the updated value at each time-step. See the attached file (saved in R2020a). It reads the value of variable 'x' from base-workspace.
  3 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 5 月 28 日
I am glad to be of help!
zahra hosaini
zahra hosaini 2021 年 9 月 7 日
OMG
this actualy works!
i have been looking for a week
thank you very much for the answer

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by