cumprod matlab code example Example: cumprod matlab returns cumulative product vec = [1 2 3 4 5] cumprod(vec) --> 1 2 6 24 120