## File Exchange Pick of the WeekOur best user submissions

Greg's Pick of the Week is Add Simulink Blocks from a given Model File with context menu by Paul.

While newer versions of Simulink have a feature that lists the most commonly used blocks in the context menu, this File Exchange entry allows you to explicitly define blocks that you want available from the context menu.

This File Exchange entry also provides a good example of how to customize the Simulink environment.

### Contents

Once you have downloaded this File Exchange entry and unzip it, make sure that you:

• Ensure the directory where you unzipped the file is on the MATLAB Path.
• Enter the following at the MATLAB Command Prompt
• >> sl_refresh_customizations

Now when you right-click on the Simulink canvas, there is a list of the blocks found in the custom_context_menu_blocks.mdl file.

### How Is This Different Than "Most Frequently Used Blocks"?

Many of you may note that in more recent versions of Simulink, there is a list of the most frequently used blocks available in the context menu for the Simulink canvas.

The blocks listed here change depending which library blocks are used most often. The list that is created using Paul's method is static, and does not change based on usage. In addition the names that appear in Paul's list don't use the full library path name for the block.

### How Does the Custom Menu Work?

The SL_CUSTOMIZATION file contains a definition of the customization, as well as the callback functions that might be executed as part of the customization.

These files can be used to:

• Customize views of the Simulink library browser
• Disable buttons and options in the model configuration parameters
• Hook into the C-code generation process in Simulink Coder

The sl_refresh_customizations command is used to register the SL_CUSTOMIZATION files with Simulink.