symprod
Symbolic product of a sequence.
Category: Mathematics > Calculus
Syntax
P = symprod(f, k, a, b)
Product of f as the index k runs from a to b.
Description
For numeric limits the product is evaluated exactly: symprod(k, k, 1, 5) is 120. With a symbolic upper limit the result is a closed form when one is known, and symprod(k, k, 1, n) is factorial(n).
Input arguments
f- Symbolic expression in the index.
k- Product index.
a, b- Lower and upper limits, possibly symbolic.
Output arguments
P- Symbolic product.
Example
Factorial as a product
syms k n
symprod(k, k, 1, 5)
symprod(k, k, 1, n)
Output
ans = 120
ans = factorial(n)