Error trying to start Simulink from m-file.
조회 수: 16 (최근 30일)
이전 댓글 표시
In an SImulink model I had two scripts as my Model initializaiton functions (those are called "Achs-Data" and "Init_Sim"). I need to write a new script which runs those two scripts (so I get the variables I need to run Simulink in the workspace) and then starts the simulation. (I can't keep them as the InitFcn's because after the simulation finishes some parameters should be changed an the simulations has to be repeated).
So if i start those scripts in my new script by calling their names (which gets the parameters to the workspace as I want it to be) an then start the Simulation with sim('Gelenkmodell') an error occurs. ("Reibkennlinie_festlegen" is the name of my new script; 'Gelenkmodell' the name of the Simulink model)
How can i avoid this error? Respectively what might me the source of the error?
Sorry if my question is inaccurate, I am pretty new to Matlab.
Error using Reibkennlinie_festlegen (line 17)
Error evaluating 'InitFcn' callback of block_diagram 'Gelenkmodell'.
Callback string is 'Reibkennlinie_festlegen;'
Caused by:
Error using Reibkennlinie_festlegen (line 17)
Cannot start a new command line simulation while an update diagram or a simulation has started for
the same model
댓글 수: 1
답변 (1개)
Walter Roberson
2024년 4월 26일
It sounds as if the block diagram 'Gelenkmodell' is configured with an InitFcn that invokes Reibkennlinie_festlegen but that Reibkennlinie_festlegen is a script that invokes a simulink model instead of just configuring the current simulink model.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!