Polar Figure Time Figure navigation bar

Table of Contents

Text Figure

Prints formatted text in a separate window or on a uicontrol within a Matlab GUI.

Library

QUARC Targets/Sinks/Figures

Description

Text Figure

The Text Figure block prints formatted text. The Figure mode parameter determines where the text is rendered.

If the figure mode is "Use figure window" then the text is rendered in a separate window. In this case, the text window is opened by double-clicking on the block, just like a regular Scope. The properties of the block are accessed by clicking on the Text Figure Properties button on the toolbar or by right-clicking on the text and selecting Text Figure Properties from the context menu. The help for the block is also accessible from a toolbar button and the context menu.

If the figure mode is "Use axes in GUI" then the text is rendered on a uicontrol within a preexisting MATLAB GUI. The GUI and uicontrol are identified by the tag name associated with the figure and the uicontrol. For example, a GUI created with GUIDE will have a tag name of 'figure1' and the first text control placed in the GUI will have a tag name of 'text1'. In this mode, double-clicking on the block will bring the GUI window forward if it is open, and add a context menu to the uicontrol in the GUI. Otherwise it opens the block properties dialog. To access the properties of the block from the uicontrol in the MATLAB GUI, right-click on the uicontrol and select Text Figure Properties from the context menu. The help for the block is also accessible from this context menu. Note that the context menu is not available until either starting the model or double-clicking on the Text Figure block.

For AppDesigner GUIs, set the Tag property of the figure and the label under the Component Browser/IDENTIFIERS section of the figure and label to the tags used in the Text Figure block.

The Text Figure is available in the Signal & Scope Manager and External Mode Control Panel just like a Scope. As such, it may be used as a Viewer and it responds to the same triggering options as Scopes.

The Text Figure block formats its inputs according to the given format string and displays the formatted text in the figure window or MATLAB GUI.

The frequency at which the text is updated may be changed using the Decimation parameter, which is the number of samples that will be skipped before the text is redrawn. For example, if the inputs to the block are 1kHz signals and the decimation is set to 100 samples then the text will be updated every 1/10th of a second (0.001 seconds * 100 samples), resulting in good performance. Making the decimation too small results in more updates than necessary and the text may fail to keep up with the data arriving at its inputs.

To access the help for the block, click on the Text Figure Help button in the figure window or select the Text Figure Help... menu item available in the context menu opened by right-clicking on the uicontrol.

Input Ports

...

The input ports contain the data to be formatted. The number of input ports is determined by the number of format specifiers, such as %lg, in the specified format string. The %n format specifier is not supported. All other valid format specifiers cause corresponding input ports to be created. Variable-sized field widths, precisions and code unit specifiers also cause input ports to be created in order to specify the field width, precision or maximum number of code units.

Output Ports

This block has no output ports.

Data Type Support

For scalar quantities, the Text Figure block accepts signals of any of the built-in Simulink data types at its data inputs. Fixed point is not currently supported.

For array quantities, as indicated by a dimension specifier in the format string, the Text Figure block only accepts signals of the data type corresponding to the format specifier at that port.

Parameters and Dialog Box

Text Figure

Figure mode

The figure mode determines whether the plot is rendered in a separate figure window or whether it is rendered on a set of axes contained within a MATLAB GUI. See the Description above for details.

Figure tag

This parameter is only visible when the figure mode is "Use axes in GUI". It identifies the MATLAB GUI in which the plot axes are contained by its tag name. The tag name may be changed in GUIDE by clicking on the background of the figure and then opening the Properties window. Scroll down to the "Tag" property in the Properties window. The default tag for figures is "figure1".

Text tag

This parameter is only visible when the figure mode is "Use uicontrol in GUI". It identifies the uicontrol on which to print by the tag name of the uicontrol. The tag name may be changed in GUIDE by clicking on the uicontrol and then opening the Properties window. Scroll down to the "Tag" property in the Properties window. The default tag for the first text control in the figure is "text1".

Format string

The format string used to format the data. Refer to the Format Strings for Printing page for a description of the format string. This parameter is treated as a string literal. It is not evaluated. Hence, do not enclose the format string in quotes unless you wish the quotes to appear in the output.

Maximum number of code units to print

This parameter restricts the total number of code units written to the stream. This limit is a hard limit. The total number of code units written to the stream will never exceed this limit, even if the output for an input port is truncated or all the input ports have not been included in the output.

Justification

This parameter determines the horizontal justification of the text. It may be set to left, center or right.

Decimation

The decimation determines the frequency with which the text is redrawn. It is specified in samples. The smaller this parameter the more frequently the text is redrawn. The text is redrawn every (decimation * sample time) seconds. Updating the text faster than 1/10th of a second is generally unnecessary and is not recommended as it compromises performance.

Sample time

The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.

A sample time of -1 indicates that the block inherits its sample time from the input. The block inherits the sample time by default.

To set the sample time to the fundamental sampling time of the model, use the qc_get_step_size function, which is a QUARC function that returns the fundamental sampling time of the model. The fundamental sampling time of the model is the sampling time entered in the Fixed step size field of the Solver pane of the Configuration parameters.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

Yes

Yes

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

Yes

Yes

QUARC QNX x86 Target

Yes

Yes

Last fully supported in QUARC 2018.

Rapid Simulation (RSIM) Target

Yes

Yes

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

* Compatible means that the block can be compiled for the target.

See Also

 

navigation bar