Unformatted text preview: elements in a vector. The cumulative product of the j th element of the vector x, x j , is defined by p j = (x 1 )(x 2 ) . .. (x j ) for j = 1:length of the vector x. Now write a program that uses two for-loops to explicitly carry out the calculations, element by element. An "inner" loop should accumulate the product and an "outer" loop should more through the elements of the vector p....
View Full Document
- Fall '08
- pj, Petroleum Engineering Homework, random-number generator rand