フィルターのクリア

How can I prevent the sim command from bringing the model to the top?

2 ビュー (過去 30 日間)
Randy
Randy 2015 年 10 月 21 日
コメント済み: Randy 2015 年 12 月 18 日
I'm doing Monte Carlo simulations and would like to suppress the sim command from bringing the model window to the top.

回答 (1 件)

Robert
Robert 2015 年 10 月 21 日
I am running MATLAB R2015a on Windows 7 and the sim command doesn't bring my model into focus. What version of MATLAB are you running and on what operating system?
In any case, unless you need to have the Simulink window open, load_system might solve your problem. Rather than opening your model by name alone, or with open_system, or through the Open menu in MATLAB or Simulink, or by opening the file directly outside of MATLAB; call load_system(my_model_name_as_a_string) to load the system without making the Simulink editor window visible. See doc load_system for details.
  3 件のコメント
Robert
Robert 2015 年 11 月 5 日
Is the variable model a string containing the name of your model? Or are you entering the model name as a command. The latter will open the model as if you had called open_system on it. I suppose if load_system(model) didn't make the model visible then you must be using a string.
Therefore I suspect the model callbacks. If you look at the model properties (right-click in white space in your model window) you will see a Callbacks tab. Any not empty model callback will have an asterisk following its name in the list on the left.
For example, your StartFcn might be doing some operation that opens the model window.
Randy
Randy 2015 年 12 月 18 日
Robert, That's helpful. I have a block in my model that has a StartFcn callback that opens the model. I do this because I need to initialize the model so that blocks setup their userdata, which is scanned to do some other initialization functions. I'll investigate whether I can use load_system there (or eliminate the need to open/load) and if that solves the problem.
thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by