问题
I've got a long list of comments in a separate document that refer the named subsystem blocks within a Simulink model. I'm going to process the document with a script that will generate a browser-viewable page, with each block name clickable - such that when you click on the block name, Matlab will launch using a CLI command, and display the model which the comment refers to.
The document generation and shell function call is all working, but I can't find a command that will centre on a specific block. I'm looking for a type of "find/search" function to centre the view on a specified block, once the model has been opened using a standard open command from the command-line.
I suspect that it might not be possible, but worth asking. Any ideas?
Thanks
回答1:
Use the hilite_system command. For example:
hilite_system( 'myModel/Path/to/my/block' );
The selected block is also highlighted, you can use the optional second parameter to remove highlighting, or customize it, if desired.
来源:https://stackoverflow.com/questions/6252873/command-to-show-open-a-simulink-model-and-focus-on-a-specific-block