Using Matlab..... Create the following matrix A: A = [6 43 2 11 87 12 6 34 0 5 3
ID: 3930325 • Letter: U
Question
Using Matlab.....
Create the following matrix A: A = [6 43 2 11 87 12 6 34 0 5 34 18 7 41 9] Use the matrix A to: Create a five-element row vector named va that contains the elements of the second row of A. Create a three-element row vector named vb that contains the elements of the fourth column of A. Create a ten-element row vector named vc that contains the elements of the first and second rows of A. Create a six-element row vector named vd that contains the elements of the second and fifth columns of A.Explanation / Answer
A = [6,43,2,11,87;12,6,34,0,5;34,18,7,41,9]
va = A(2,:)
vb = A(:,4)
vc = A(1:2,:)
vd = [A(:,2),A(:,5)]
% sample output
A =
6 43 2 11 87
12 6 34 0 5
34 18 7 41 9
va =
12 6 34 0 5
vb =
11
0
41
vc =
6 43 2 11 87
12 6 34 0 5
vd =
43 87
6 5
18 9
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.