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

2 次查看(过去 30 天)
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?

采纳的回答

the cyclist
the cyclist 2012-6-23
Straight out of the documentation:
cumprod(X,DIM) works along the dimension DIM
  1 个评论
Martijn
Martijn 2012-6-23
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by