generate::TeX

Generate formatted string from expressions

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.

Syntax

generate::TeX(e)

Description

generate::TeX(e) returns a TeX formatted string representing e. This string may be printed to a file using fprint. Use the printing option Unquoted to remove quotes and to expand special characters like newlines and tabs.

The output string may be used in the math-mode of TeX. Note that generate::TeX doesn't break large formulas into smaller ones.

Examples

Example 1

generate::TeX generates a string containing the TeX code:

generate::TeX(hold(int)(exp(x^2)/x, x))

Use print with option Unquoted to get a more readable output:

print(Unquoted, generate::TeX(hold(int)(exp(x^2)/x, x)))
\int \frac{{\mathrm{e}}^{x^2}}{x} \,d x

Parameters

e

An arithmetical expression

Return Values

generate::TeX returns a string containing TeX code.

Overloaded By

e

Algorithms

The TeX packages amsmath and amssymb are needed.

See Also

MuPAD Functions