| Using Simulink | ![]() |
Creating Annotations Programmatically
You can use the Simulink add_block command to create annotations at the command line or in an M-file program. Use the following syntax to create the annotation:
where path is the path of the diagram to be annotated, text is the text of the annotation, and [center_x, 0, 0, center_y] is the position of the center of the annotation in pixels relative to the upper left corner of the diagram. For example, the following sequence of commands
new_system('test') open_system('test') add_block('built-in/Gain', 'test/Gain', 'Position', [260, 125, 290, 155]) add_block('built-in/Note','test/programmatically created', 'Position', [550 0 0 180])
To delete an annotation, use the find_system command to get the annotation's handle. Then use set_param to set the annotation's Name property to the empty string, e.g.,
| Using TeX Formatting Commands in Annotations | Creating Subsystems | ![]() |
© 1994-2005 The MathWorks, Inc.