Create the following matrix M: M= Use the matrix M to: Create a five element row
ID: 1719808 • Letter: C
Question
Create the following matrix M: M= Use the matrix M to: Create a five element row vector named MatA that contains the elements of the second row of M. Create a three element row vector named MatB that contains the elements of the fourth column of M. Create a ten element row vector named MatC that contains the elements of the first and second rows of M. Create a six element row vector named MatD that contains the elements of the second and fifth columns of M. Create these 3 arrays by using either commas or line space: A= B= C=[49.5 49.1875 48.875 48.5625 48.25 47.9375 47.625 47.3125 47] Replace the last 4 columns of the 1^st and 4^th rows of A with the last 4 columns of the 1^st and 3^rd rows of B. Replace the first 4 columns of the 2nd row of A with the 2nd, 4th, 6th, 8^th elements of C. Replace the 2^nd and 3^rd rows of the last column of A with the last 2 rows of the 1^st column of B.Explanation / Answer
Background : Any Matrix M is a rectangular array consisting of m rows and n columns (rows are horizontally laid out and columns are vertically laid out ).
For instance, the Matrix M given in Problem 1 consists of 3 rows and 6 columns.
The Matrix A given in Problem 2 consists of 6 rows and 5 columns
The Matrix B given in Problem 2 consists of 3 rows and 6 columns
The Matrix C given in Problem 2 consists of 1 row and 9 columns.
Problems 1 and 2 dont involve any calculation. It is just replacing appropriate blocks of a given matrix A by the blocks (maintaining the same number of rows and columns) by another matrix B.
Solution to Problem 1:
(a) MatA = [12 6 34 0 5]
(b) MatB = [ 11 0 41]
(c) MatC = [ 6 43 2 11 87 12 6 34 0 5]
(d) MatD = [43 6 18 11 0 41]
Solution to Problem (2):
(a) The last 4 columns of the first and 4th rows of A are
2 3 4 5
14 15 16 17
This block needs to be replaced by the last 4 columns of the 1st and 3rd rows of B, which consists of
17 23 29 35
65 70 75 80
Thus the new (transformed matrix ) will look like
1
17
23
29
35
5
6
7
8
9
9
10
11
12
13
13
65
70
75
80
17
18
19
20
21
21
22
23
24
25
(b) The first 4 columns of the 2nd row of A are
5 6 7 8
This needs to be replaced by the 2nd, 4th , 6th and 8th elements of C. It is clear that the modified matrix is given by
1
2
3
4
5
49.1875
48.5625
47.9375
47.3125
9
9
10
11
12
13
13
14
15
16
17
17
18
19
20
21
21
22
23
24
25
(c) The 2nd and 3rd rows of the last column of A consist of
9
13
They need to be replaced by the last 2 rows of the 1st column of B , consisting of
27
55
resulting in the transformed matrix
1
2
3
4
5
5
6
7
8
27
9
10
11
12
55
13
14
15
16
17
17
18
19
20
21
21
22
23
24
25
1
17
23
29
35
5
6
7
8
9
9
10
11
12
13
13
65
70
75
80
17
18
19
20
21
21
22
23
24
25
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.