필터 지우기
필터 지우기

How do I force subsystems in a library to open in the same window in R2012a?

조회 수: 4 (최근 30일)
Scaler
Scaler 2016년 8월 24일
댓글: Vidya Viswanathan 2016년 8월 30일
I am working with a large Simulink model in R2012a. I want to navigate the model in a single model window. In my Simulink preferences, I have set "Window reuse" to "reuse", which seems to work for models, but not libraries. That is, when I double-click on a subsystem in a model, the subsystem opens in the same window; but when I double-click on a subsystem in a library, the subsystem opens in a new window.
Is there a way to force Simulink to reuse windows when navigating both models and libraries?
On a related note, I sometimes open subsystems programmatically, and in these cases, I would also like to reuse the current window. If I know what subsystem is currently open in the window I can use the syntax:
% open 'f14' into the 'f14/Controller' window in 'reuse' mode
open_system('f14','f14/Controller','reuse');
But how can I find out--programmatically--which subsystem is currently open? For example, if the window is currently in 'f14/Nz pilot\ncalculation/Pilot\ng force (g)', the command above will fail:
Invalid system for 'replace' with OPEN_SYSTEM
If there is only one model open, then it is sufficient to use gcs:
open_system('f14', gcs, 'reuse');
But suppose I have two models open, and the current system is not in the same model as the one I want to open. Then Simulink complains:
The current system must be in the same hierarchy as the system being opened when reusing windows
I could verify that the model is open using
bdLoaded = find_system('Type', 'block_diagram');
But how would I check which subsystem is currently displayed in a model window for a model other than the current system?
  댓글 수: 1
Vidya Viswanathan
Vidya Viswanathan 2016년 8월 30일
The Window Reuse option in Simulink Preferences does not work with Simulink libraries. However, there is a programmatic approach to enable this:
set_param(0, 'WindowReuseForLibraries', 'reuse')

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by