prod

description:

p = prod(A,dim) is product of the elements. For vectors, prod(A) is the product of the elements of A. For matrices, prod(A) or prod(A,1) is a row vector of column products and prod(A,2) is a column vector of row products.

arguments:

A is a matrix of NCpolys

dim tells if it is a column (1) or row (2) product; for matrices is default 1

output:

row/column of NCpolys

possible usage:

prod(A), prod(A,dim)

example:

>> v=[x x+y y];

>> prod(v)

ans = x^2*y+x*y^2

>> A=[x x+y y; x-y y x+y];

>> prod(A)

ans =  x^2-x*y   x*y+y^2   y*x+y^2

>> prod(A,2)

ans =           x^2*y+x*y^2

      x*y*x+x*y^2-y^2*x-y^3