Documentation

使用注释描述模型

Annotations are visual elements that you can use to add descriptive notes and callouts to your model. You can also add annotations that perform an action when you click them.

文本annotations can contain any combination of:

  • 文本

  • Images

  • Equations using LaTeX and MathML commands

  • Hyperlinks that open a website or perform MATLAB®functions

另外,您可以创建仅图像的注释。

Add a Text Annotation

要创建文本注释,请使用以下选项之一:

  • 双击您要创建注释的画布并选择创建注释from the menu.

  • Click the annotation boxon the Simulink®编辑一直te and then click the canvas.

  • 将注释框拖到画布上。

After you add the text annotation, you can:

  • Apply formatting changes to text or insert an image, table, or equation using the formatting toolbar.

  • Apply additional formatting, using theParagraphmenu on the context menu. For example, you can create bullet and numbered lists from this menu.

  • 使用上下文菜单添加超链接。您可以使用超链接打开网站或使用MATLAB命令进行注释交互式。

  • Apply properties using the Property Inspector. To view the Property Inspector, in theModelingtab, underDesign, clickProperty Inspector.

Resize an Annotation

注释在输入内容时进行调整大小。您还可以通过拖动角来调整注释大小。例如,你可以举行Shift当您拖动以比例调整大小时。

After you resize an annotation, the annotation stays that size until you resize it again, regardless of the content size. To revert to the original height or width of the annotation, in the Property Inspector, under外貌,清除Fixed height或者Fixed widthcheck box.

进行注释互动

要使注释交互式,请在文本注释的任何内容上使用超链接。

  1. In the annotation, select the content that you want to make interactive. To make the entire annotation interactive, select all the content.

  2. 右键单击并选择Hyperlink从上下文菜单。

  3. In the Hyperlink dialog box, either:

    • SelectURL Address作为目标并在Code盒子。

    • SelectMATLAB代码as the target and enter MATLAB functions in theCode盒子。

  4. Click好的.

对于另一种方法,请参阅Add an Annotation Callback

Add an Image Annotation

When you want to resize or move an image independently from text, create an image annotation. For example, you can size and position your company logo at a particular location in the model. You can also invoke MATLAB functions with a click on the image. To add an annotation that contains an image, drag the image from your file system to the canvas.

Tip

To include an image such as a logo in every new model, add the image to your default template. SeeCreate a Template from a Model.

Alternatively, you can drag anImage盒子from the palette onto the canvas. Then you can either:

  • Double-click the image box and browse to an image.

  • 从剪贴板粘贴图像。右键单击图像框,然后选择Paste Image.

Tip

If you resize an image, you can reset it to its original size. Right-click the image and select格式>Restore Size.

把一个动作和一个图像:

  1. Select the image.

  2. 在财产检查员中,ClickFcn,添加您要通过单击图像调用的MATLAB函数。

在注释中添加方程式

You can add equations to your annotation by clicking the插入方程button in the annotation formatting toolbar.

In the Edit Equation dialog box, enter LaTeX or MathML code to generate equations. For LaTeX commands, seeInsert LaTeX Equation(MATLAB)。

要编辑方程式代码,请双击注释中的方程式。与注释中的文本类似,您可以使用格式工具栏在注释中格式化方程式。您可以更改注释中方程式的字体颜色,文本突出显示颜色,字体大小和方程的位置。

Associate Annotations with Blocks and Areas

You can add a line between an annotation and a block or area in a model. These annotation connectors attach dynamically at both ends, so that they move and resize as necessary to maintain the connection.

  1. Place the cursor over the annotation outline where you want the line to start.

  2. When the cursor is a crosshair, drag the line to the block or area where you want the line to end.

Tip

To specify the color or width of an annotation connector, right-click it and use the格式menu.

相关话题

See Also