f(inputs) = formula
creates the symbolic function f. For example, f(x,y) =
x + y. The symbolic variables in inputs are the
input arguments. The symbolic expression formula is the body of
the function f.
f = symfun(formula,inputs)
is the formal way to create a symbolic function.
Return the body of a symbolic function by using formula. You can use the body for operations such as indexing into the function. Return the arguments of a symbolic function by using argnames.
Index into the symbolic function [x^2, y^4]. Since a symbolic function is a scalar, you cannot directly index into the function. Instead, index into the body of the function.
formula — Function body symbolic expression | vector of symbolic expressions | matrix of symbolic expressions
Function body, specified as a symbolic expression, vector of symbolic expressions, or matrix
of symbolic expressions that can be converted to sym data
type.
Example: x + y
inputs — Input argument or arguments of function symbolic variable | array of symbolic variables
Input argument or arguments of a function, specified as a symbolic
variable or an array of symbolic variables, respectively.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.