prodΒΆ

prod calculates the product of all elements for real or complex vectors. If the argument is a matrix, a row vector will be created that contains the product of the matrix columns.

mProd = prod(m)

Return Value

mProd is a scalar it m is vector. If m is a matrix it is a row vector.

Parameters

m

m is a real or complex matrix.

Example

* m = int(rand(3,3) * 10) + 1
* m
    1.0000     3.0000     8.0000
    8.0000     1.0000     4.0000
    4.0000     2.0000     8.0000
* prod(m)
   32.0000     6.0000   256.0000
* prod(prod(m))
49152.0000

See also

sum

id-33035