How to change model properties of a .slx simulink model using the MATLAB script
조회 수: 10 (최근 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!