Scilab Function

prod - product

Calling Sequence

y=prod(x)
y=prod(x,'r') or y=prod(x,1)
y=prod(x,'c') or y=prod(x,2)

Parameters

Description

For a vector or a matrix x, y=prod(x) returns in the scalar y the prod of all the entries of x, , e.g. prod(1:n) is n!

y=prod(x,'r') (or, equivalently, y=prod(x,1))computes the rows elementwise product of x. y is the row vector: y(i)=prod(x(i,:)).

y=prod(x,'c') (or, equivalently, y=prod(x,2)) computes the columns elementwise product of x. y is the column vector: y(i)=prod(x(:,i)).

prod is not implemented for sparse matrices.

Examples

See Also