Why do I get an error message when I try to close the Simulink 7.1 (R2008a) Library Browser?

2 views (last 30 days)
In my application, I would like to close the Simulink Library Browser unconditionally, irrespective of whether it was open or not.
I used to use
simulink('close');
to close the library, even if it is not open at all during the current MATLAB session. It used to work just fine until R2008a,where I receive the following error if the Simulink library is never opened:
Error: Simulink Library Browser is not open
The interesting thing is that, if during the current MATLAB session the Simulink library has been opened and closed, calling the above command will no longer yield an error.
How can I workaround this error message?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The message 'Error: Simulink Library Browser is not open' you get when attempting to do Simulink('Close') for the first time, is simply a display message. This message will not stop the execution of any commands you may have after Simulink('Close') in your script.
While it might be difficult to determine if the Simulink Library Browser was opened anytime before in the current session, you can use the following workaround to unconditionally close the Library Browser:
lb = LibraryBrowser.StandaloneBrowser; %get an handle to the library browser
lb.hide %hide the browser irrespective of whether it is open or not

More Answers (0)

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Products


Release

R2008a

Community Treasure Hunt

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

Start Hunting!