Documentation Center

  • Trial Software
  • Product Updates


Format and insert text into report


This component formats and inserts text into the report. It must have the Paragraph component as its parent.


Text to include in report: Specifies text to include in the report.

%<VariableName> Notation

You can enter %<VariableName> in this field (and in any field where the text appears blue) to include the value of a variable from the base MATLAB® workspace. You cannot enter more than one variable in %<>. If you enter an invalid variable name, the report includes the text %<VariableName> instead of the value of the variable.


  1. Enter the following text:

    I have a %<ObjName> and it has %<NumLeaves> leaves. 
    The word '%<ObjName>' has %<size(ObjName)> letters.
  2. Set ObjName = "plant" and NumLeaves = 3.

  3. Generate the report. It looks as follows:

    I have a plant and it has 3 leaves.
    The word 'plant' has 5 letters.


  • Bold: Makes the text bold.

  • Italic: Makes the text italic.

  • Underline: Underlines the text.

  • Strikethrough: Strikes through the text.

  • Subscript: Formats text as a subscript, in a smaller font than the other text, set slightly below the other text.

  • Superscript: Formats text as a superscript, in a smaller font than the other text, set slightly above the other text.

  • Retain spaces and carriage returns: Formats the text in the report as you entered it.

  • Show text as syntax-highlighted MATLAB code: Shows the text as syntax-highlighted MATLAB code.

  • Color: Specifies the color of the text.

    • Select a color from a list of colors.

    • Enter %<expr>.

    • Enter an RGB (truecolor) value as #RRGGBB. For example, #0000ff is a shade of blue.

Insert Anything into Report?

Yes. Text.



Was this topic helpful?