Products & Services Solutions Academia Support User Community Company

Learn more about Symbolic Math Toolbox   

findsym - Determine variables in symbolic expression or matrix

Syntax

findsym(S)
findsym(S,n)

Description

findsym(S) for a symbolic expression or matrix S, returns all symbolic variables in S in lexicographical order, separated by commas. If S does not contain any variables, findsym returns an empty string.

findsym(S,n) returns the n variables alphabetically closest to x:

  1. The variables are sorted by the first letters in their names. The ordering is x y w z v u ... a X Y W Z V U ... A. The name of a symbolic variable cannot begin with a number.

  2. For all subsequent letters the ordering is alphabetical, with all uppercase letters having precedence over lowercase: 0 1 ... 9 A B ... Z a b ...z.

Examples

syms a x y z t X1 x2 xa xb
findsym(sin(pi*t))
ans =
t
findsym(x+i*y-j*z)
ans =
x,y,z
findsym(a+y,1)
ans =
y
findsym(X1 + x2 + xa + xb)
ans =
X1,x2,xa,xb
findsym(X1 + x2 + xa + xb,4)
ans =
x2,xa,xb,X1

See Also

compose, diff, int, limit, symvar, taylor

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS