prod
Product of array elements
Syntax
B = prod(A)
B = prod(A,dim)
B = prod(___,type)
B = prod(___,nanflag)
Description
returns the product of the array elements of B
= prod(A
)A
.
-
If
A
is a vector, thenprod(A)
returns the product of the elements. -
If
A
is a nonempty matrix, thenprod(A)
treats the columns ofA
as vectors and returns a row vector of the products of each column. -
If
A
is an empty 0-by-0 matrix,prod(A)
returns1
. -
If
A
is a multidimensional array, thenprod(A)
acts along the first nonsingleton dimension and returns an array of products. The size of this dimension reduces to1
while the sizes of all other dimensions remain the same.
如果A是向量,则prodÿ