필터 지우기
필터 지우기

Error trying to start Simulink from m-file.

조회 수: 17 (최근 30일)
Moritz Koch
Moritz Koch 2019년 5월 27일
답변: Walter Roberson 2024년 4월 26일
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
Angel
Angel 2024년 4월 26일
이동: DGM 2024년 4월 26일
I've just encountered the same issue. Too bad no one replied to you yet.

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

답변 (1개)

Walter Roberson
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.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by