prod - product
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.
A=[1,2;0,100]; prod(A) prod(A,'c') prod(A,'r')