Collect coefficients.
Syntax
R = collect(S)
R = collect(S,v)
Description
For each polynomial in the array S of polynomials, collect(S) collects terms containing the variable v (or x, if v is not specified). The result is an array containing the collected polynomials.
Examples
The following statements
syms x y;
R1 = collect((exp(x)+x)*(x+2))
R2 = collect((x+y)*(x^2+y^2+1), y)
R3 = collect([(x+1)*(y+1),x+y])
return
R1 =
x^2+(exp(x)+2)*x+2*exp(x)
R2 =
y^3+x*y^2+(x^2+1)*y+x*(x^2+1)
R3 =
[(y+1)*x+y+1, x+y]
See Also
expand, factor, simple, simplify, syms
[ Previous | Help Desk | Next ]