Subexpressions or terms of symbolic expression
children(expr)
children(A)
children(
returns
a vector containing the child subexpressions of the symbolic expression expr
)expr
.
For example, the child subexpressions of a sum are its terms.
children(
returns
a cell array containing the child subexpressions of each expression
in A
)A
.

Symbolic expression, equation, or inequality. 

Vector or matrix of symbolic expressions, equations, or inequalities. 
Find the child subexpressions of this expression. Child subexpressions of a sum are its terms.
syms x y children(x^2 + x*y + y^2)
ans = [ x*y, x^2, y^2]
Find the child subexpressions of this expression. This expression is also a sum, only some terms of that sum are negative.
children(x^2  x*y  y^2)
ans = [ x*y, x^2, y^2]
The child subexpression of a variable is the variable itself:
children(x)
ans = x
Find the child subexpressions of this equation. The child subexpressions of an equation are the left and right sides of that equation.
syms x y children(x^2 + x*y == y^2 + 1)
ans = [ x^2 + y*x, y^2 + 1]
Find the child subexpressions of this inequality. The child subexpressions of an inequality are the left and right sides of that inequality.
children(sin(x) < cos(x))
ans = [ sin(x), cos(x)]
Call the children
function for this matrix.
The result is the cell array containing the child subexpressions of
each element of the matrix.
syms x y s = children([x + y, sin(x)*cos(y); x^3  y^3, exp(x*y^2)])
s = [1x2 sym] [1x2 sym] [1x2 sym] [1x1 sym]
To access the contents of cells in the cell array, use braces:
s{1:4}
ans = [ x, y] ans = [ x^3, y^3] ans = [ cos(y), sin(x)] ans = x*y^2