Main Content

Write In-Model Documentation Using Notes

To provide extensive background information or instructions for a model, you can write notes in the Notes pane of the Simulink® Editor. The notes can include text, images, hyperlinks, equations, and website content. To add labels, short descriptions, images, equations, and hyperlinks to the canvas, use annotations instead. For more information about annotations, see Annotate Models.

Notes are stored in a file with the extension .mldatx. You can create a new notes file or edit an existing notes file. The notes file is saved separately from the model file. If you move your model file to a different folder, the notes file does not move with the model file. If the notes file is on the MATLAB® path, the association between the model file and the notes file persists. Notes files contain the model name and version information, so you can check that the notes file matches the model.

The software can only read from and write to one notes file at a time. However, you can create multiple notes files for use with the same model, for example, for users with different roles. The person using the model can load the file pertaining to their role.

The content the Notes pane displays is specific to the component in the model hierarchy you are in, for example, a chart or subsystem. If you navigate to a different component, you see the content for that component. For each component in your model, you can set what the Notes pane displays: notes associated with the component or with the parent component, the content of a website, or nothing.

In the sldemo_enginewc model, the Model Browser window is open and the Throttle subsystem is selected. The Throttle subsystem is shown in the canvas. The Notes pane is open. The text box in the Notes pane displays the text "Enter notes about the Throttle subsystem here." The title bar of the Notes pane displays the filename sldemo_enginewc_notes.mldatx. The Edit Notes button is in the upper left corner of the Notes pane, and the Show Options button is in the upper right. Both buttons have callouts. The callout text for the Edit Notes button is "Click to edit notes". The callout text for the Show Options button is "Click to change file".

View Notes

You can view notes in the Notes pane. To show the Notes pane, in the Simulink Toolstrip, on the Modeling tab, click the arrow on the far right of the Design section. In the Design gallery, under Review, click Model Notes. Alternatively, press Ctrl+Shift+N.

To find out which notes file you are viewing the contents of, check the top of the Notes pane. If the model has an associated notes file, the top of the Notes pane displays the name of the notes file the software is reading from and writing to. If a model does not have an associated notes file, the top of the Notes pane displays this message: This model does not have notes associated with it.

To load and view the contents of a different notes file, click the Show Options button . Click the Use an existing notes file button . Select an MLDATX file and click Open.

To view the notes associated with a model component, navigate to the component. For example, to view the notes for a subsystem, enter the subsystem. To set what the Notes pane shows for a component, click the Edit Notes button . Then, from the drop-down list at the top of the Notes pane, select one of these options.

  • Write Notes – Display the notes associated with the component.

  • Use URL for Notes – Enter the URL of a website you want to display.

  • Show Parent Notes – If the component has a parent component, display the notes associated with the parent component.

  • No Notes – Hide the notes.

Add and Edit Notes

  1. Navigate to the component you want to add notes to or whose note you want to edit.

  2. Open the Notes pane.

  3. Check the top of the Notes pane to see whether the model has an associated notes file.

    If the model has an associated notes file and the Create a notes file and Use an existing notes file buttons are not visible in the Notes pane, click the Show Options button .

    If the model does not have an associated notes file, or if you want to change the associated notes file, create a new notes file or open an existing notes file.

    • To create a new file, in the Notes pane, click the Create a notes file button . Enter a name for the notes file or use the default name, then click Save.

    • To open an existing file, in the Notes pane, click the Use an existing notes file button . Select a MLDATX file and click Open.

  4. Enter edit mode. When you create a new notes file, you automatically enter edit mode. If you open an existing notes file, or if the model already has an associated notes file and you skipped the previous step, click the Edit Notes button to enter edit mode.

  5. Add or edit the contents of the note.

    • To add text, enter the text in the text box.

    • To inherit the notes from the parent component, from the drop-down list at the top of the Notes pane, select Show Parent Notes.

      Drop-down list with Show Parent Notes selected

    • To add images, include hyperlinks, or add equations, use the Image , Link , and Equation Editor buttons, respectively. You can mix text, images, hyperlinks, and equations in the same note. You can include multiple images, hyperlinks, and equations in the same note.

    • To use web content as the note, from the drop-down list at the top of the Notes pane, select Use URL for Notes. In the text box in the Notes pane title bar, enter the web content URL. Then, press Enter. You can only display the contents of one URL in the note.

      In the Notes pane, the "Use URL for Notes" option is selected. In the text box, the URL https://www.mathworks.com/ is entered. Below the URL, the contents of the MathWorks website are displayed.

  6. To toggle the notes to read-only mode, click the Read Notes button .

Note

The notes you add are saved automatically.

Hide and Show Notes

  1. Navigate to the component whose notes you want to hide. For example, to hide the notes of a subsystem, enter the subsystem.

  2. Open the Notes pane.

  3. To enter edit mode, click the Edit Notes button .

  4. To hide the notes of the component you are in, from the drop-down list at the top of the Notes pane, select No Notes.

    If the notes of the component you are in are hidden, to show the notes, select Write Notes.

    Drop-down list with No Notes selected

  5. To toggle the notes to read-only mode, click the Read Notes button .

Related Topics