Display variable text centered on masked subsystem icon
fprintf(text
) fprintf(formatSpec
,var
)
The fprintf
command displays formatted text centered on the icon
and can display formatSpec
along with the contents of
var
.
Note
While this fprintf
function is identical in name to its
corresponding MATLAB® function, it provides only the functionality described on this
page.
formatSpec
can be a character vector in single quotes, or a string
scalar.
Formatting Operator
A formatting operator starts with a percent sign, %
, and ends with
a conversion character. The conversion character is required. Optionally, you can
specify identifier, flags, field width, precision, and subtype operators between
%
and the conversion character. (Spaces are invalid between
operators and are shown here only for readability).
Conversion Character
This table shows conversion characters to format numeric and character data as text.
Value Type | Conversion | Details |
---|---|---|
Integer, signed |
|
Base 10 |
Integer, unsigned |
|
Base 10 |
|
Base 8 (octal) | |
|
Base 16 (hexadecimal), lowercase letters
| |
|
Same as | |
Floating-point number |
|
Fixed-point notation (Use a precision operator to specify the number of digits after the decimal point.) |
|
Exponential notation, such as | |
|
Same as | |
|
The more compact of | |
|
The more compact of | |
Characters or strings |
|
Single character |
|
Character vector or string array. The type of the output text is
the same as the type of |
The command
fprintf('Hello');
displays the text 'Hello'
on the icon.
The command
fprintf('Hello = %d',17);
uses the decimal notation format (%d
) to
display the variable 17
.
disp
| port_label
| text