pretty

Prints a symbolic expression in a readable form.

Category: Symbolic Computations in MATLAB > Symbolic Variables, Expressions, Functions, and Preferences

Syntax

pretty(S)

Displays the expression S in the command window.

Description

pretty writes a symbolic expression as text that is easier to read than the default one-line display: in MATLAB, fractions are drawn with a horizontal bar and exponents are raised, using ASCII characters. It prints and returns nothing.

For a symbolic matrix it prints the rows between brackets.

Input arguments

S
Symbolic expression or array.

Example

Fraction and matrix

syms x y
pretty(x^2/(x + 1))
pretty([x 1; 2 y])
Output
x^2/(x + 1)
[x, 1]
[2, y]

Notes

MatLivre prints the expression on a single line in linear form (x^2/(x + 1)) rather than as two-dimensional ASCII art.

See also

latex disp simplify vpa