Check out example codes for "cumprod matlab". It will help you in understanding the concepts better.

Code Example 1

returns cumulative product 

vec = [1 2 3 4 5]

cumprod(vec) -->
	1 2 6 24 120

Learn ReactJs, React Native from akashmittal.com