Registering Customizations

About Registering User Interface Customizations

You must register your user interface customizations using a MATLAB® function called sl_customization.m. This is located on the MATLAB path of the Simulink® installation that you want to customize. The sl_customization function should accept one argument: a handle to a customization manager object. For example:

function sl_customization(cm)

The customization manager object includes methods for registering menu and control customizations (see Customization Manager). Your instance of the sl_customization function should use these methods to register customizations specific to your application. For more information, see the following sections on performing customizations.

The sl_customization.m file is read when the Simulink software starts. If you subsequently change the sl_customization.m file, you must restart the Simulink software or enter the following command at the command line to effect the changes:

sl_refresh_customizations

Customization Manager

The customization manager includes the following methods:

  • addCustomMenuFcn(stdMenuTag, menuSpecsFcn)

    Adds the menus specified by menuSpecsFcn to the end of the standard Simulink menu specified by stdMenuTag. The stdMenuTag argument is a string that specifies the menu to be customized. For example, the stdMenuTag for the Simulink editor's Tools menu is 'Simulink:ToolsMenu' (see Displaying Menu Tags for more information). The menuSpecsFcn argument is a handle to a function that returns a list of functions that specify the items to be added to the specified menu. See Add Items to Model Editor Menus for more information.

  • addCustomFilterFcn(stdMenuItemID, filterFcn)

    Adds a custom filter function specified by filterFcn for the standard Simulink model editor menu item specified by stdMenuItemID. The stdMenuItemID argument is a string that identifies the menu item. For example, the ID for the New Model item on the Simulink editor's File menu is 'Simulink:NewModel' (see Displaying Menu Tags for more information) . The filterFcn argument is a pointer to a function that hides or disables the specified menu item. See Disable and Hide Model Editor Menu Items for more information.

Was this topic helpful?