asked 64.1k views
5 votes
What would be the output of the following code (in editor window)? >> A 1 point = [1 1 0 0]; B = [1 2 3 4]: C=A*B 3 O [1200] O o O [1000] Clear selection Which choice will NOT give you a 5 x 5 identity matrix? 1 point a = rand(5); round(a* inv(a)) identity (5) eye(5) diag(ones(5, 1))

1 Answer

2 votes
The main answer is that the output of the given code would be `[1 1 0 0; 2 2 0 0; 3 3 0 0; 4 4 0 0]`.Explanation:Given:A = [1 1 0 0];B = [1 2 3 4];C = A * B;Now, let's multiply these two matrices to get the resultant matrix.We can obtain the output of matrix multiplication by taking the dot product of each row of the first matrix and each column of the second matrix.Calculating:1*1 + 1*2 + 0*3 + 0*4 = 32*1 + 2*2 + 0*3 + 0*4 = 63*1 + 3*2 + 0*3 + 0*4 = 94*1 + 4*2 + 0*3 + 0*4 = 12So the resulting matrix, C would be: C = [3 6 0 0; 4 8 0 0; 0 0 0 0; 0 0 0 0]The answer is [1000]. This is not a 5 x 5 identity matrix and thus it is the matrix that will NOT give you a 5 x 5 identity matrix.
answered
User Alaa Masoud
by
7.7k points

No related questions found