Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB please see image second row are the numbers 89 10 11 1213 14, the third r

ID: 3676917 • Letter: M

Question


MATLAB
please see image

second row are the numbers 89 10 11 1213 14, the third row are the twambvers VS O 21, and so on. From this matrix, create a new 3 X S matrix than is made from tows 2 through 4 and columns I, 3 and 5 through 7 of the first matrix. 5) Create a 2 X 3 matrix where all elements are twos, a 1 X 3 vector where all elements are threes, a 3 X 2 matrix where all elements are fours, a 3 X 3 matrix where all elements are fives, and a 3 X 3 matrix where all elements are nines. Then starting with the matrix consisting of twos, add elements to this matrix by appending the other matrices such tha you create the second matrix in problem 2 as shown below 2220 sss 2 2 2 0 5 5 5 3 3 3 0 5 5 5 A 10 0 0 1 0 0 0 4 4 70 9 9 9 4 4 7 0 99 9 4 4 7 0 99 9

Explanation / Answer

twoXThree2 = [2 2 2; 2 2 2];
3 3];
threeXTwo4 = [4 4; 4 4; 4 4];
threeXThree5 = [5 5 5; 5 5 5; 5 5 5];
threeXThree9 = [9 9 9; 9 9 9; 9 9 9];

zeroesColumn = [0 0 0];
zeroesVector = [0; 0; 0];

result = [twoXThree2; oneXThree3];

%{
result =

2 2 2   
2 2 2   
3 3 3
%}

% add zeroes column
result = [result [0; 0; 0]];

%{
result =

2 2 2 0   
2 2 2 0   
3 3 3 0   
%}

% add 3x3 fives
result = [result threeXThree5];

%{
result =

2 2 2 0 5 5 5   
2 2 2 0 5 5 5   
3 3 3 0 5 5 5
%}

% append middle row
result = [result; [0 0 0 1 0 0 0]];

%{
result =

2 2 2 0 5 5 5   
2 2 2 0 5 5 5   
3 3 3 0 5 5 5   
0 0 0 1 0 0 0   
%}

% create matrix below middle line
lower = [threeXTwo4 [7; 7; 7]];

%{
lower =

4 4 7   
4 4 7   
4 4 7   
%}

% add zeroes column
lower = [lower [0; 0; 0]];

%{
lower =

4 4 7 0   
4 4 7 0   
4 4 7 0   
%}

% add 3x3 9's matrix
lower = [lower threeXThree9];

%{
lower =

4 4 7 0 9 9 9   
4 4 7 0 9 9 9   
4 4 7 0 9 9 9   
%}

% Now add this to final result
result = [result; lower];

%{
result =

2 2 2 0 5 5 5   
2 2 2 0 5 5 5   
3 3 3 0 5 5 5   
0 0 0 1 0 0 0   
4 4 7 0 9 9 9   
4 4 7 0 9 9 9   
4 4 7 0 9 9 9
%}