필터 지우기
필터 지우기

Simulink model in a for loop

조회 수: 4 (최근 30일)
Mitch Martelli
Mitch Martelli 2011년 11월 9일
Hi at all, I have a problem when I run a simulink model inside a for loop.
More in detail when I run the model with the command:
set_param('model_name','SimulationCommand','start')
the script doesn't wait the end of the simulation before continue...
There some commands like the waitfor or the drawnow?
Thanks
M1tc4

채택된 답변

Titus Edelhofer
Titus Edelhofer 2011년 11월 9일
Hi Mitch,
I would usually suggest to use the function sim for running simulations, or is there any reason you can't use sim?
Titus
  댓글 수: 5
Titus Edelhofer
Titus Edelhofer 2011년 11월 9일
Hi Mitch,
sorry, set_param was wrong, it's simset that you need to use
opt = simset('DstWorkspace', 'current');
and pass this to sim.
Sorry!
Titus
Mitch Martelli
Mitch Martelli 2011년 11월 9일
Fantastic... I dont need to open the model... I dont need to put a pause...All the variables are stored in the workspace with the correct name...
Thanks a lot Titus

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by