modelName - String input of the model name.
This function is an attempt to highlight the blocks those are not contributing to the model simulation directly.
This function is also useful to study the impact of optimization settings of model configuration parameters.
We can identify whether a block is used during the model simulation and it is not optimized by the following methods.
1. If we can setup add_exec_event_listener for the block
2. If we can get the run time object of the block.
The tool uses the second method. Because with the first one, the script can't be used more than once in the same session.
If used it would highlight all the blocks as it can't add the listed again.
Please go through the help >>help add_exec_event_listener.
Sample: Unzip the contents and run hilite_virtual_blocks('check_path') in the MATLAB command prompt. Note: 'check_path' is a sample model in the attachment.
Please compare the Simulink block sorted order for the same. This gives some idea on how the Simulink engine works.
---- Sorted list for 'check_path' [2 nonvirtual blocks, directFeed=0]
0:0 'check_path/Constant' (Constant, tid=-2)
0:1 'check_path/Scope' (Scope, tid=1)
Call the function again by changing the optimization settings and find the differences from the previous run.
Play it with a larger model. This function potentially can be used for studying model coverage.
- It will not work across model reference boundaries. Hence it has to be executed for the referenced models manually.
- The automation creates unsaved changes, but the changes can be ignored.
- Model should be simulatable.
Please feel free to improve it and add your comments.