[MATLAB] Write a function called myMultProd.m that computes thecumulative product of the elements in a vector. The cumulativeproduct, pj, of the jth element of the vector x, xj, is defined bypj = (x1)(x2) … (xj) for j = 1:length of the vector x. For example,when you run your function it should look like this: >> x =[2 3 4 2]; >> myMultProd(x) >> ans = 2 6 24 48 That is,the function returns: 2, 2*3, 2*3*4, 2*3*4*2 where 2 is p1, 2*3 isp2, 2*3*4 is p3, etc.
a) Do this first using two for loops to explicitly carry out thecalculation element-byelement.
PayPal Gateway not configured
PayPal Gateway not configured