MATLAB Function Reference
  Go to function:
    Search    Help Desk 
primes    Examples   See Also

Generate list of prime numbers

Syntax

Description

p = primes(n) returns a row vector of the prime numbers less than or equal to n. A prime number is one that has no factors other than 1 and itself.

Examples

See Also

factor      Prime factors



[ Previous | Help Desk | Next ]