MATLAB: How do you use the cumprod function for the third dimension

cumprodstack of matricesthree dimensions

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?

Best Answer

Straight out of the documentation:
cumprod(X,DIM) works along the dimension DIM