Register Customizations with Simulink
In Simulink®, you can register multiple customizations with an
sl_customization
function.
Set Up Customization File
To register customizations, use a MATLAB® function file named sl_customization.m
. Place the function on the MATLAB path of the Simulink installation that you want to customize or in the current folder.
You can have more than one sl_customization.m
file. The customizations in
each file take effect, with conflicts handled by each customization. For example, if you specify
priorities for libraries in multiple sl_customization.m
files, only one takes
effect. If you add the same menu item twice, it appears twice. To ensure that customizations
load as expected, refresh the customizations as described in Read and Refresh Customization Files.
The sl_customization
function accepts one argument: a handle to the customization manager object (cm
). For example:
function sl_customization(cm)
Edit the Customization File
In your sl_customization
function, use customization manager object
properties and methods specific to your application to register customizations. You can use
customization properties and methods to:
Additional MathWorks® products use the customization manager object and the
sl_customization.m
file. Refer to the product documentation to learn
about the methods and properties that apply to a product other than Simulink.
Read and Refresh Customization Files
The sl_customization.m
file is read when Simulink starts. If you change the sl_customization.m
file, either restart Simulink or enter this command to see the changes:
sl_refresh_customizations
This command runs all sl_customization.m
files on the MATLAB path and in the current folder. Some side effects of running
sl_refresh_customizations
include:
Rebuilding the Simulink Toolstrip
Rebuilding all Simulink Editor menus
Rebuilding the Library Browser menus and toolbars
Clearing the Library Browser cache and refreshing the Library Browser
Reloading the Viewers and Generators Manager data