Set more than one variable in model workspace?

3 ビュー (過去 30 日間)
Michael
Michael 2021 年 7 月 20 日
回答済み: Tanmay Das 2021 年 9 月 15 日
Hi, I'm using the RL Toolbox/Simulink and I want my reset function to change the values of two variables in my model's workspace, step1 and step2. How would I modify my reset function to do this? Thanks for any help!
env.ResetFcn = @(in)setVariable(in,'step1',0.13,'Workspace',mdl);

回答 (1 件)

Tanmay Das
Tanmay Das 2021 年 9 月 15 日
Hi,
ResetFcn resets behavior for the environment, specified as a function handle or anonymous function handle. The function must have a single Simulink.SimulationInput input argument and a single Simulink.SimulationInput output argument. The reset function sets the initial state of the Simulink environment.
SimulinkEnvWithAgent documentation may help you find a solution to your problem. You can go through the examples to gain a better understanding.

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by