- https://mathworks.com/help/simulink/slref/get_param.html
- https://mathworks.com/help/matlab/ref/assignin.html
- https://mathworks.com/help/simulink/slref/save_system.html
How to programmatically modify parameters in the workspace
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
"How can I programmatically modify the value of ECMS-s in the model workspace?![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1806929/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1806929/image.png)
0 Kommentare
Antworten (1)
Madheswaran
am 13 Nov. 2024
Bearbeitet: Madheswaran
am 13 Nov. 2024
Hi,
Here's how you can programmatically modify the Simulink Model Workspace:
my_model = 'HevP2OptimalController';
load_system(my_model);
modelWorkspace = get_param(my_model, 'ModelWorkspace');
assignin(modelWorkspace, 'ECMS_s', 5);
save_system(my_model);
close_system(my_model, 1);
For more information, refer to the following documentations:
Hope this helps!
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!