How do you use the cumprod function for the third dimension?

2 views (last 30 days)
I want to calculate the cumulative product of a stack of matrices, without using an iterative loop. The cumprod function can do this for dimension 1 and 2, but it it also somehow possible to apply such a function on the third dimension?

Accepted Answer

the cyclist
the cyclist on 23 Jun 2012
Straight out of the documentation:
cumprod(X,DIM) works along the dimension DIM
  1 Comment
Martijn
Martijn on 23 Jun 2012
Ha, thank you. My mistake.... I tried the function with a stack of ones, which works for cumsum but off course not for cumprod ;)
Thanks

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!