Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

# Symbolic Variables, Expressions, Functions, and Preferences

Create symbolic variables, expressions, functions, and set preferences

Symbolic Math Toolbox™ introduces a special data type — symbolic objects. This data type includes symbolic numbers, symbolic variables, symbolic expressions, and symbolic functions. It also includes vectors, matrices, and multidimensional arrays of symbolic numbers, variables, expressions, and functions. Using symbolic objects in computations indicates that MATLAB® must perform these computations analytically instead of numerically. Symbolic computations are exact and are not prone to round-off errors. For a quick guide on creating symbolic variables, expressions, and functions, see Create Symbolic Numbers, Variables, and Expressions and Create Symbolic Functions.

## Functions

expand all

 `fold` Combine (fold) vector using function `piecewise` Conditionally defined expression or function `sym` Create symbolic variables, expressions, functions, matrices `str2sym` Evaluate string representing symbolic expression `symfun` Create symbolic functions `syms` Create symbolic variables and functions `symvar` Find symbolic variables in symbolic input
 `argnames` Input variables of symbolic function `children` Subexpressions or terms of symbolic expression `formula` Return body of symbolic function `has` Check if expression contains particular subexpression
 `pretty` Prettyprint symbolic expressions
 `isfinite` Check whether symbolic array elements are finite `isinf` Check whether symbolic array elements are infinite `isnan` Check whether symbolic array elements are NaNs
 `funtool` Function calculator `sympref` Set symbolic preferences

## Topics

Create Symbolic Numbers, Variables, and Expressions

Use symbolic values and variables.

Create Symbolic Functions

Use symbolic functions that accept symbolic inputs, such as `f(x,y)`.

Create Symbolic Matrices

Use matrices containing symbolic values.

Find Symbolic Variables in Expressions, Functions, Matrices

Find variables in symbolic expressions.

## Featured Examples

#### Mathematical Modeling with Symbolic Math Toolbox

Get examples and videos