How to run simulink from matlab script, pause the simulation, change constant values, and continue the simulation
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi all, I want to run a simulation from a matlab script (or function) using workspace variables as parameter values for constant blocks in the simulation. I want to be able to pause the simulation at a specific time (say 10 seconds in) and change the value of the constant, then resume the simulation. Is there a way to do this. As a simple descriptive example, lets say I have a simulation which plots A*sin(wt) in a scope. 'A' and 'w' are constant blocks with values which are defined in the workspace with A=1 and w=1. At 1 second into the simulation, I want to pause it and change A=2, then continue the simulation. Is it possible to do this in a matlab script? If so, please let me know how.
댓글 수: 0
답변 (1개)
kintali narendra
2016년 9월 23일
"sim" is the name of the function which can run the simulation from through programming. check the link below for more details
https://www.mathworks.com/help/simulink/ug/using-the-sim-command.html
참고 항목
카테고리
Help Center 및 File Exchange에서 Schedule Model Components에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!