symvar
Determine the variables in an expression.
📝Syntax
v = symvar(expr)
📥Input Arguments
Parameter Description
expr Expression as text (character vector, string scalar) or a function handle.
📤Output Arguments
Parameter Description
v Column cell array of variable names.
📄Description

symvar returns the names of the variables used in expr, sorted alphabetically and without duplicates.

Identifiers that resolve to a function or a builtin (including the special values pi, i, j, eps, Inf and NaN), language keywords and field access names are not reported as variables.

💡Examples
v = symvar('sin(x) + a*y')
🔗See Also
vectorizefunc2striskeyword
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub