| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| R2010b Documentation → Symbolic Math Toolbox |
| Contents | Index |
| Learn more about Symbolic Math Toolbox |
factor(X)
factor(X) can take a positive integer, an array of symbolic expressions, or an array of symbolic integers as an argument. If N is a positive integer, factor(N) returns the prime factorization of N.
If S is a matrix of polynomials or integers, factor(S) factors each element. If any element of an integer array has more than 16 digits, you must use sym to create that element, for example, sym('N').
Factorize the two-variable expression:
syms x y; factor(x^3-y^3)
The result is:
ans = (x - y)*(x^2 + x*y + y^2)
Factorize the expressions that form a vector:
syms a b; factor([a^2 - b^2, a^3 + b^3])
The result is:
ans = [ (a - b)*(a + b), (a + b)*(a^2 - a*b + b^2)]
Factorize the symbolic number:
factor(sym('12345678901234567890'))The result is:
ans = 2*3^2*5*101*3541*3607*3803*27961
collect, expand, horner, simplify, simple

See how symbolic computations can help you find analytical solutions to math and engineering problems.
Get free kit| © 1984-2010- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |