Skip to Main Content Skip to Search
Product Documentation

text - Display text at specific location on masked subsystem icon

Syntax

text(x, y, 'text')
text(x, y, 'text', 'horizontalAlignment', 'halign', 
  'verticalAlignment', 'valign')
text(x, y, 'text', 'texmode', 'on')

Description

The text command places a character string at a location specified by the point (x,y). The units depend on the Drawing coordinates parameter.

text(x,y, text, 'texmode', 'on') allows you to use TeX formatting commands in text. The TeX formatting commands in turn allow you to include symbols and Greek letters in icon text. See Mathematical Symbols, Greek Letters, and TeX Characters in the MATLAB documentation for information on the TeX formatting commands supported by Simulink software.

You can optionally specify the horizontal and/or vertical alignment of the text relative to the point (x, y) in the text command.

The text command offers the following horizontal alignment options.

Option

Aligns

'left'

The left end of the text at the specified point

'right'

The right end of the text at the specified point

'center'

The center of the text at the specified point

The text command offers the following vertical alignment options.

Option

Aligns

'base'

The baseline of the text at the specified point

'bottom'

The bottom line of the text at the specified point

'middle'

The midline of the text at the specified point

'cap'

The capitals line of the text at the specified point

'top'

The top of the text at the specified point

Examples

The command

text(0.5, 0.5, 'foobar', 'horizontalAlignment', 'center')

centers foobar in the icon.

The command

text(.05,.5,'{\itEquation:}  \Sigma \alpha^2 + 
\beta^2 \rightarrow \infty, \Pi, \phi_3 = {\bfcool}', 
'hor','left','texmode','on')

draws a left-aligned equation on the icon.

See Also

disp | fprintf | port_label

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS