For the function name and arguments, use W = DotPro(V,U) . The input arguments V
ID: 2943414 • Letter: F
Question
For the function name and arguments, use W = DotPro(V,U). The input arguments V and U are the vectors to be multiplied. The output argument W is the result (a scalar).
(a) Use DotPro to determine the cross product (the book says cross product, but I think it means dot product judging by the question) of the vectors v = i + 2j + 3k and u = 3i + 2j + k.
(b) Use DotPro to determine the cross product (the book says cross product, but I think it means dot product judging by the question) of the vectors v = -2i + j - 3k and u = i + j + k.
Explanation / Answer
function DotPro = DotPro(v,u)
DotPro = 0;
for i=1:3
DotPro = DotPro+v(i)*u(i);
end
a) V = [1 2 3];
U = [3 2 1];
DotPro(V,U)
b)
V = [-2 1 -3];
U = [1 1 1];
DotPro(V,U)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.