How to change model properties of a .slx simulink model using the MATLAB script
11 次查看(过去 30 天)
显示 更早的评论
Sachin Ganesh Uma Maheswaran
2021-3-3
评论: Sachin Ganesh Uma Maheswaran
2021-3-8
Hello,
I am working on automated test scripts which involve calling mulltiple simulink models from inside a single simulink model. So I would like to access and edit the model porperties of all these simulink files at once using a matlab script.
For example, in the picture, I want to change the design Data definition from Base Workspace to Data Dictionary without having to open the simulink model and going to model properties, but directly from the command window. Does anyone know a way for it?
0 个评论
采纳的回答
Mark McBroom
2021-3-6
Model configuration settings can be controlled from MATLAB code using the get_param() and set_param() functions. Help will tell you the name of the parameter. In this case:
set_param(modelName,'DataDictionary',dictionaryName);
3 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!