フィルターのクリア

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 Center および File ExchangeEvent Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by