Suppose A 1 2 3 4 5 6 7 8 9 In Matlab what is the result of
Suppose A = (1 2 3; 4 5 6; 7 8 9). In Matlab what is the result of command, A([2, 2], :) ? (a) [1 2 3 4 5 6] (b)][4 5 6 7 8 9] (c) [4 5 6 4 5 6] (d) [4 5 6] (e) 2 5 8] Let a = eye (3, 3); b = [1; 2; 3]; a(;, 3) = b; What is a = ? (a) [1 0 0 0 1 0 0 0 1] (b) [1 0 0 0 1 0 1 2 3] (c) [1 0 0 1 2 3 0 0 1] (d) [1 1 0 0 2 0 0 3 1] (e) [1 0 1 0 1 2 0 0 3]
Solution
Here is the answers for your questions.
Answer:
24) D
25) E
Explanation:
24) D
Because A(k,:) displays the kth row
Here you have been given 2,2 i.e entire 2nd row i.e 4 5 6
because
1 2 3
4 5 6
7 8 9
is the matrix
25) E
because
a = eye(3,3)
=
1 0 0
0 1 0
0 0 1
now b =
1
2
3
now
a(:,3)
=
i.e. 3 rd column will be replace by b
that comes
1 0 1
0 1 2
0 0 3
is the answer
![Suppose A = (1 2 3; 4 5 6; 7 8 9). In Matlab what is the result of command, A([2, 2], :) ? (a) [1 2 3 4 5 6] (b)][4 5 6 7 8 9] (c) [4 5 6 4 5 6] (d) [4 5 6] (e Suppose A = (1 2 3; 4 5 6; 7 8 9). In Matlab what is the result of command, A([2, 2], :) ? (a) [1 2 3 4 5 6] (b)][4 5 6 7 8 9] (c) [4 5 6 4 5 6] (d) [4 5 6] (e](/WebImages/32/suppose-a-1-2-3-4-5-6-7-8-9-in-matlab-what-is-the-result-of-1093784-1761576350-0.webp)