Why do I get an error message when I try to close the Simulink 7.1 (R2008a) Library Browser?
2 次查看(过去 30 天)
显示 更早的评论
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?
采纳的回答
MathWorks Support Team
2009-6-27
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
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!