<< peaks Special functions

primes


Prime numbers less than or equal to input value


Syntax


p = primes(n)

Input argument


n

scalar, real integer value

Output argument


p

vector with prime numbers.

Description


p = primes(n) returns a row vector containing all the prime numbers less than or equal to n.

The data type of p is the same as that of n.

Example


p = primes(15)

See also


factor.

History


Version Description
1.0.0 initial version

Author


Allan CORNET

<< peaks Special functions