how to do Serial and Parrarell computing, multiple simulink models in a loop?

조회 수: 2 (최근 30일)
Mona Faraji Niri
Mona Faraji Niri 2019년 9월 4일
댓글: Nicolas B. 2019년 9월 6일
Hi all,
I have two simulink files that need to run in a loop.
I have the first file sim1.slx that should run for some time and provide an output which is the input for sim2.slx. Then sim2.slx runs and afterwards it should get back to the first file sim1.slx and do this untill a counter reaches a limit.
I know that this is easy in codes and Matlab scripts, but my platform is only based on simulink.
has anyone any clues how to do this?
best regards
Mona

답변 (1개)

Nicolas B.
Nicolas B. 2019년 9월 5일
Hi Mona,
I would recommend you to take a look at the parsim command. Its documentation is very well done and give multiple examples.
Hope it helps.
Regards
  댓글 수: 6
Mona Faraji Niri
Mona Faraji Niri 2019년 9월 5일
if I put the first model in the Simulation> model Properties> callbacks > startFnc of the simulation configuration, this may run the first model and provide output to the second model. but how I can get back from model B to A again?
Nicolas B.
Nicolas B. 2019년 9월 6일
The risk with what you are trying to do is that you will end up in an infinite loop because model A call model B and model B call model A.
However, if you really want to go that way, I would simply do the same thing in model B to call model A.

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

카테고리

Help CenterFile Exchange에서 Manual Performance Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by