Set parameter of Simulink
조회 수: 6 (최근 30일)
이전 댓글 표시
Hi. I have created an '*.m' file with a string which calls a simulink file:
Temperature= sim('TRT_tuning','SrcWorkspace','Current','stoptime','359');
Now, I'd like to set the stoptime, i.e. '359', from the workspace (like the command 'input'). How Can I do this? Thanking you for your attention, I'm looking forward for your answers.
댓글 수: 0
답변 (2개)
Azzi Abdelmalek
2012년 10월 22일
편집: Azzi Abdelmalek
2012년 10월 22일
set_param('TRT_tuning','stop time','359')
or
stime=359
set_param('TRT_tuning','stop time',num2str(stime))
댓글 수: 0
Kaustubha Govind
2012년 10월 22일
You could probably use a model callback function like PostLoadFcn or InitFcn to call any MATLAB code (like INPUT) to get the value from user input and use SET_PARAM with that value.
댓글 수: 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!