How do I call a script to modify base workspace variables in the PreSimFcn of "parsim"?

6 ビュー (過去 30 日間)
I have a script which I usually call to modify my base workspace variables before simulation. I am now trying to move to a "parsim" workflow, and need to use the Simulink.SimulationInput objects. Is there a way I can call this script in the PreSimFcn of the Simulink.SimulationInput so that my variables are correctly set before each simulation? I don't want to have to set each variable with the setVariable() method on the Input Object.

採用された回答

MathWorks Support Team
MathWorks Support Team 2021 年 6 月 23 日
Please find such an example attached. It uses a script to change the value of “Ka” in the base workspace based on the run number. It uses evalin() in the PreSimFcn to both assign the dependent variables and call the script in the base workspace.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRun Multiple Simulations についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by