1. Create the following maltrix in MATLAB: 11 12 13 14 21 22 23 24 31 32 33 34 1
ID: 2088600 • Letter: 1
Question
1. Create the following maltrix in MATLAB: 11 12 13 14 21 22 23 24 31 32 33 34 11 12 43 4 2. Now, create the same matrix using the colon operator for matrix indexing each row. 11 12 13 14 3. Again, create the same matrix using the colon operator for matrix indexing each column. 21 31 41 4. Complete a combination of matrix manipulation, row/column edit, using the colon operator for specifying rows and colunns. First, begin with a blank sqaure matrix with 16 zero entries by using a built-in function. Then, update the values of each row with its respective increasing tens place. Finally, update the values of each column with the corresponding ones place. 10 10 10 10 31. 5. Using the colon operator for specifying rows and colunns, extrapulate sections of matrix A to produce the following four 2x2 square matrices. 11 12 21 22 13 14 Ds=123 24 31 32 Ds41 42 33 31 D43 44Explanation / Answer
1.)
a = [11 12 13 14; 21 22 23 24; 31 32 33 34; 41 42 43 44]
2.)
a(1,:) % output 1st row
a(2,:) % output 2nd row
a(3,:) % output 3rd row
a(4,:) %output 4th row
3.)
a(:,1) % output 1st column
a(:,2) % output 2nd column
a(:,3) % output 3rd column
a(:,4) % output 4th column
4.)
b = zeros(4,4) % output 4X4 zero matrix
b + 10 % output increase 10 in each zero value
5.)
D1(1:2,1:2) % extract value from 1st and 2nd row corrospond to 1st and 2nd column
D2(1:2,2:3) % extract value from 1st and 2nd row corrospond to 3rd and 4th column
D3(2:3,1:2) %extract value from 3rd and 4th row corrospond to 1st and 2nd column
D4(2:3,3:4) % extract value from 3rd and 4th row corrospond to 3rd and 4th column
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.