The cumulative product of matrix elements in a specified dimension. |
||
Syntax |
P = CumProd(M, DIM) |
|
Argument |
Name |
Description |
M |
A vector or a matrix. |
|
DIM (optional) |
The dimension on which to multiply. For products by column, dim = 1. For products by row, dim = 2. If m is a matrix, dim defaults to 1. |
|
Output |
Name |
Description |
P |
The cumulative product of row/column vector elements. p will have the same dimensions as m. |
|
Example |
Find the cumulative row products of a matrix. |
|
Syntax |
||
P = CumProd([1,2;3,4], 2) |
||
Result |
||
P = [1, 2 3, 12] |
||
See Also: |