1.
Suppose I first execute the following Octave/Matlab commands:
Which of the following are then valid commands? Check all that apply. (Hint: A' denotes the transpose of A.)
答案 AB
C = A * B;
C = B' + A;
C = A' * B;
C = B + A;
B = A(:, 1:2);
B = A(1:4, 1:2);
B = A(0:2, 0:4)
B = A(1:2, 1:4);
v = A * x;
v = Ax;
v = x' * A;
v = sum (A * x);
4.Say you have two column vectors v and w , each with 7 elements (i.e., they have dimensions 7x1). Consider the following code:
答案AB
Which of the following vectorizations correctly compute z? Check all that apply.
z = sum (v .* w);
z = w' * v;
z = v * w';
z = w * v';
C = X + 1;
D = X / 4;
A = log (X);
B = X ^ 2;