Octave/Matlab Tutorial
Say you have two column vectors vvv and www, each with 7 elements (i.e., they have dimensions 7x1). Consider the following code:
z = 0;
for i = 1:7
z = z + v(i) * w(i)
end
Which of the following vectorizations correctly compute z? Check all that apply.
z = sum (v .* w); z = w' * v;