Vectorize this code! Write one assignment statement that will accomplish exactly the same thing as the given code (assume that the variable vec has been initialized): Exercises
newv = zeros(size(vec));myprod = 1;for i = 1:length(vec) myprod = myprod * vec(i); newv(i) = myprod;endnewv % Note: this is just to display the value
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.