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.
Once you have downloaded this File Exchange entry and unzip it, make sure that you:
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.
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.
Paul takes advantage of the Simulink customization feature "sl_customization.m" files.
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:
The sl_refresh_customizations command is used to register the SL_CUSTOMIZATION files with Simulink.
For more information on customizing Simulink and the SL_CUSTOMIZATION functions, check out Customizing the Simulink User Interface
If you would like to leave any comments regarding this post, please click here.
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.