Maximum number of characters in an output line
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
The environment variable
the maximum number of characters in one line of screen output.
Possible values: Positive integer smaller than 231.
Output is broken into several lines if it needs more than
Deletion via the statement “
TEXTWIDTH to its default value. Executing
restores the default value.
The minimal value of
TEXTWIDTH is 10.
TEXTWIDTH is set to its maximum value 231 -
1 when printing to a text file using
fprint. Thus, no additional
line breaks occur in the output.
TEXTWIDTH does not influence the typesetting
of expressions which is available for some user interfaces of MuPAD®.
TEXTWIDTH is set to the new number of available
columns every time the console is resized.
Set the maximum number of characters in one line of screen output to 15:
TEXTWIDTH := 15:
TEXTWIDTH to its default value:
The following procedure adds empty characters to produce output that is flushed right:
myprint := proc(x) local l; begin if domtype(x) <> DOM_STRING then x := expr2text(x); end_if; l := length(x); print(Unquoted, _concat(" " $ TEXTWIDTH - l, x)) end_proc:
myprint("hello world"): myprint(30!): myprint("bye bye"):