Filter löschen
Filter löschen

Is it possible to move the standard library simulink.mdl from it's installed location?

2 Ansichten (letzte 30 Tage)
I have edited the standard Simulink block library (simulink.mdl located under ...\MATLAB\R2011b\toolbox\simulink\blocks\library)so that it improves conformance with the MAAB rules (such as hiding names on certain blocks). I want to share this with others on my team to use, so I thought I could place it under version control and then just add the path so that it picks up my version of the library before the standard one. This however gives me the following warning...
Warning: Function C:\Program
Files\_file_store\matlabRoot\libs\standard\2011b\simulink.mdl
has the same name as a MATLAB builtin. We
suggest you rename the function to avoid a
potential name conflict.
> In path at 110
In addpath at 87
...and when I click to open Simulink, it simply opens the new version of the simulink.mdl library and not the library browser. If I manually call the libbrowse2 function (in libbrowse2.m), it opens the browser. The work around I have at the moment is a script to copy it from version control to the installation directory, overwriting the original. This works fine. Is there something I am missing or is this just not possible?
Thanks, Chris

Antworten (1)

Ryan G
Ryan G am 5 Okt. 2012
Bearbeitet: Ryan G am 5 Okt. 2012
If you wanted to modify the base simulink.mdl file, I would suggest renaming it and sending it out as a different library. The big challenge from your current workflow is upgrading. Although you may be version-locked now, when you try to upgrade later there will probably be a bunch of issues that arise and you may forget exactly what you changed.
Try this:
1) Save the new simulink.mdl as SimulinkMAAB.mdl (or something like that, also save as .slx if you are in a newer version).
2) Add SimulinkMAAB to your library browser. This Solution should still work in newer versions.
3) Disperse the library to your colleagues.
Although you can't force them to use this as you would changing Simulink.mdl, some gentle nudging should get everyone on the same page to use this library over the standard simulink library.
  2 Kommentare
Chris
Chris am 8 Okt. 2012
I thought of doing that (and had already tried it), but this means I have two versions of the Simulink blocks in the library browser, with the default being at the top and the other way down the list. We do not swap between versions of Matlab as they come out - it has to be an agreed upgrade path - so upgrading would not be an issue for us more than it is already. The idea of what I want to do is to make life easier for the people on the team. I am surprised that Mathworks don't already offer this as an option as they support the rules in Model Advisor. Thanks for the suggestion though.
Ryan G
Ryan G am 8 Okt. 2012
I think even though you are version locked, you will never know where a model/library may end up in the future and the confusion from that library reference.
One thing you could do to adhere to the standards is write an m-file script to alter ALL of the blocks in the model to adhere to the standard. Hiding names on certain blocks is an easy one.
ConstantBlks = find_system(gcs,'BlockType','Constant');
cellfun(@(x) set_param(x,'ShowName','off'),ConstantBlks);
A mere 2 lines of code to hide the names of all constant blocks. You could do this to match up with the full MAAB standards and the script could easily follow any model or be used on any model.

Melden Sie sich an, um zu kommentieren.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by