This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Determine symbolic variables in expression


symvar 'expr'
s = symvar('expr')


symvar 'expr' searches the expression, expr, for identifiers other than i, j, pi, inf, nan, eps, and common functions. symvar displays those variables that it finds or, if no such variable exists, displays an empty cell array, {}.

s = symvar('expr') returns the variables in a cell array of character vectors, s. If no such variable exists, s is an empty cell array.


symvar finds variables beta1 and x, but skips pi and the cos function.

symvar 'cos(pi*x - beta1)'

ans = 


See Also

Introduced before R2006a

Was this topic helpful?