필터 지우기
필터 지우기

control simulink from mfile

조회 수: 4 (최근 30일)
Matus
Matus 2012년 3월 25일
Hi, I would like to control simulink from m-file. I wrote m-file. I start simulation (from m-file) and then I need after some time to stop simulation and change some input parameters and then continue. Is it possible? I have been looking for information about that but I havent been successful. e.g. I have a model in simulink which contains voltage source and resistance. Simulation runs 10 seconds. I would like to change every second peak amplitude of voltage source. I could use e.g. programmable voltage source but I would like to do it by means of m-file. Thank you in andvance.

채택된 답변

TAB
TAB 2012년 3월 26일
To start, stop, pause, and update your model from m-file you can use
set_param('YourModel', 'SimulationCommand', 'cmd');
Where cmd could be
start - To start simulation
stop - To stop simulation
pause - To puase simulation
continue - To continue from puase
update - To update the model
  댓글 수: 6
Matus
Matus 2012년 3월 26일
thank you, i will try
Matus
Matus 2012년 3월 29일
Thank you Kaustubha, it works great.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by