displayFormula

Displays a symbolic formula given as text.

Category: Mathematics > Formula Manipulation and Simplification

Syntax

displayFormula(str)

Parses the text str as a symbolic expression and displays it.

Description

In live scripts the formula appears in typeset mathematical form, which makes long expressions easier to read than the one-line text output. Nothing is returned. Each element of a string array is shown as a separate formula.

The argument is text, so the variables in it do not need to exist in the workspace.

Input arguments

str
String or string array with one expression per element, for example "x^2 + 1".

Example

Show an expression

displayFormula("x^2 + 1")
displayFormula(["x == 1"; "y^2"])
Output
x^2 + 1
x == 1
y^2

Notes

MatLivre prints the parsed expression as plain text instead of typeset mathematics, and does not take extra name-value arguments.

See also

disp pretty latex mathml sym