B = prod(A) returns
the product of the array elements of A.

If A is a vector, then prod(A) returns
the product of the elements.

If A is a nonempty matrix, then prod(A) treats
the columns of A as vectors and returns a row vector
of the products of each column.

If A is an empty 0-by-0 matrix, prod(A) returns 1.

If A is a multidimensional array,
then prod(A) acts along the first nonsingleton dimension and
returns an array of products. The size of this dimension reduces to 1 while
the sizes of all other dimensions remain the same.

prod computes and returns B as single if
the input, A, is single. For
all other numeric and logical data types, prod computes
and returns B as double.

B = prod(A,dim) returns
the products along dimension dim. For example,
if A is a matrix, prod(A,2) is
a column vector containing the products of each row.

B = prod(___,type) multiplies
in and returns an array in the class specified by type,
using any of the input arguments in the previous syntaxes. type can
be 'double' or 'native'.

Dimension to operate along, specified as a positive integer
scalar. If no value is specified, the default is the first array dimension
whose size does not equal 1.

Dimension dim indicates the dimension whose
length reduces to 1. The size(B,dim) is 1,
while the sizes of all other dimensions remain the same.

Consider a two-dimensional input array, A.

If dim = 1, then prod(A,1) returns
a row vector containing the product of the elements in each column.

If dim = 2, then prod(A,2) returns
a column vector containing the product of the elements in each row.

Output class, specified as 'double' or 'native',
defines the data type that the operation is performed in and output
in.

If type is 'double',
then prod computes and returns a double precision
array, regardless of the input data type. For example, if A is single,
then prod multiplies in and returns in double.

If type is 'native', prod multiplies
natively and returns an array with the same data type as the input
array A. For example, if A is
an 8-bit unsigned integer, prod multiplies natively
and returns B with data type uint8.