You can disable items that appear on the Simulink® Toolstrip and context menus. You can also hide items that appear on context menus. To disable or hide an item, you must:
function sl_customization(cm) cm.addCustomFilterFcn('Simulink:NewModel',@myFilter); end function state = myFilter(callbackInfo) state = 'Disabled'; end
Your filter function must accept a callback info object and return the state that you want to assign to the item. Valid states are:
Your filter function may have to compete with other filter functions and with Simulink itself to assign a state to an item. Who succeeds depends on the strength of the state that each assigns to the item.
'Hidden' is the strongest state. If any filter function or
'Hidden' to a menu item, it is hidden. For
Simulink Toolstrip items, specifying
'Hidden' disables the
item instead of hiding it.
'Enabled', but is
itself overridden by
'Enabled' is the weakest state. For an item to be enabled, all
filter functions and the Simulink or Stateflow® products must assign
'Enabled' to the item.
Use the customization manager
addCustomFilterFcn method to register a
filter function. The
addCustomFilterFcn method takes two arguments: a tag
that identifies the menu or item to be filtered and a pointer to the filter function itself.
For example, the following code registers a filter function for the New
Model item on the Simulink Toolstrip.
function sl_customization(cm) cm.addCustomFilterFcn('Simulink:NewModel',@myFilter); end