factor
- :
p =factor(q)¶ - :
[p, n] =factor(q)¶ Prime factorization of the non-negative integer scalar q.
With one output, p is a row vector holding all prime factors of q in ascending order, repeated according to multiplicity, so that
prod (p) == q. With two outputs, p holds the distinct primes and n (class double) their multiplicities, so thatprod (p .^ n) == q.The class of p is the class of q. The factorization is exact over the whole range of
uint64;factor (0)andfactor (1)return the argument itself.