Question: I have to make a program in matlab that does the following, my code will be attached below, I got stuck on part 3 and

I have to make a program in matlab that does the following, my code will be attached below, I got stuck on part 3 and beyond. any help would be appreciated.

3- Create a matrix named sm1 which contains the first 2 rows and last 3 columns of the matrix m divided by 4. 4- Create a matrix named sm2 which contains all the elements in column 2, column 3, and the last 3 rows of the matrix m divided by 4. 5- Create a matrix named sm3 which contains all the elements in row 1, row 3, row 4, column 1 and column 5 of the matrix m

here is my code

m=[1 2 3 4 5; 2 3 4 5 1; 3 4 5 1 2; 4 5 1 2 3; 5 1 2 3 4] m1=[ 1 2; 2 3; 3 4; 4 5; 5 1;]; m2= [ 3 4; 4 5; 5 1; 1 2; 2 3]; m3= [5 1 2 3 4]; m1=[ m1' ; m2'; m3] v=[ 5 2 -6 10 -3] v=[15; -3; 6; 2; 1] v= [45:1:49] v=linspace(12,36,5) v=linspace(2,8,5) sm1=m(1:5,1:5)/4 6- Calculate a discriminant named disc = sm32 4 * sm1 * sm2 7- Calculate the first root named r1 = 3 + 2 1 8- Calculate the second root named r2 = 3 2 1 9- Define more variables named a, b and c as follows: a. Variable a is a submatrix of the matrix m which includes all the elements from second row and second column until the forth row and forth column. b. Variable b contains only the element in the first row and second column in the matrix a. c. Variable c contains the last two elements in the last column in the matrix a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!