Variables scope in MatLab function block

2 ビュー (過去 30 日間)
Tamim Boubou
Tamim Boubou 2021 年 2 月 22 日
コメント済み: Tamim Boubou 2021 年 2 月 25 日
Hello everyone,
I have a simulink file, in which I'm using a matlabFunction block, this function is calling several other functions and files including some structures in the same path, but whenever I run the simulation, the variables that are defined in the workSpace are not visible for the "matlab function" block, is there any way of changing their scope or any approach to fix this other than having to re-define all the variables locally within that block?

採用された回答

Fangjun Jiang
Fangjun Jiang 2021 年 2 月 22 日
Use "Edit Data" in the MATLAB Function Editor to specify those base workspace variables as the parameters
  1 件のコメント
Tamim Boubou
Tamim Boubou 2021 年 2 月 25 日
Thank you!, I didn't know of this method before.

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

その他の回答 (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