Factorial of input

- example
`f = factorial(n)`

`f = factorial(`

returns
the product of all positive integers less than or equal to `n`

)`n`

,
where `n`

is a nonnegative integer value. If `n`

is
an array, then `f`

contains the factorial of each
value of `n`

. The data type and size of `f`

is
the same as that of `n`

.

The factorial of `n`

is commonly written in
math notation using the exclamation point character as *n!*.
Note that `n!`

is not a valid MATLAB^{®} syntax
for calculating the factorial of `n`

.

Was this topic helpful?