Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

I have to create a program in Matlab that does the following listed in the pictures below. I will also attach a picture of my

I have to create a program in Matlab that does the following listed in the pictures below. I will also attach a picture of my code, I am stuck on part 3 please help

image text in transcribed

image text in transcribed

the program is supposed to look like this when it's ran

image text in transcribed

image text in transcribed

and here is my code

image text in transcribed

1- Create a 5 X 5 matrix using the following methods a. Explicit list of integer numbers using semicolon: 1 2 3 4 5 2 3 4 5 1 m= 3 4 5 1 2 4 5 1 2 3 5 1 2 3 4 b. Combine the following matrices: mi + m2 + m3=m m1=134 122 m3 = [5 1 2 3 4 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 2- Create a 1 x 5 matrix using the following methods a. Explicit list of integer numbers in a row: v = [5 2 6 10-3) b. Explicit list of integer numbers in a column: v= c. Evenly spaced matrix using a colon operator: v=[45 46 47 48 49) d. Evenly spaced matrix using user increment value: v=12 18 24 30 35] e. Evenly spaced matrix using MATLAB increment value: 12.0000 3.5000 5.0000 6 5000 8.00001 3- Create a matrix named smt 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 at the elements in column 2 column 3, and the last 3 rows of the matrix m divided by 4 row 1 row 3 row 4. column 1 and 5- Create a matrix named sms which contains all the elements column 5 of the matrix m 6. Calculate a discriminant named disc = sm3- 4 *smsm -sm3 + disc 7- Calculate the first root named r1== 2 sm 8. Calculate the second root named r2 = - sm3 - Vaisc 2 sm 9. Define more variables named a band c as follows: a Vanable 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 contains only the element in the first row and second colunun in the matrix a. C. Vanable c contains the last two elements in the last column in the matrix a Submit your file in CANVAS drop box Useful Hints: 1- Variables sm1.sm2, sm3 and disc are 5 X 5 matrices 2 Variable a is a 3 x 3 matrix variable bis a scalar variable and variable C S 2 X 1 vector 3 In points 3, 4 and 5: create a table to join the columns and the transpose rows as follows a in point 3 combine the transpose of the first 2 rows with the last 3 columns of matrix m b in point combine the second and the third columns with the transpose of the last 3 rows of matrix m in point combine the transpose of the first row with the transpose of the third and fourth rows with the first and the last column of mustrim 4 in point 5 use to multiplication 5- in point 9 (c) Ure colon operator SAMPLE RUN: Welcome to MATLAB Program 2 Enter your rame Tom & Jerry Explich ist ofteger numbers using s oon - - Explicit list of integer numbers using semicolon 1 2 3 4 5 2 3 4 5 1 m= 3 4 5 1 2 4 5 1 2 3 5 1 2 3 4 Combine the given matrices 1 2 3 4 5 2 3 4 5 1 m= 3 4 5 1 2 4 5 1 2 3 5 1 2 3 4 Explicit list of integer numbers in a row. V=52 -6 10-3 Explicit list of integer numbers in a column Evenly spaced matrix using a colon operator V= 45 46 47 48 49 Evenly spaced matrix using user increment value v-12 18 24 30 36 Evenly spaced matrix using MATLAB increment value V=20 355.0 6.5 8.0 sm 0.25 0.50 075 100 1.25 0.50 0.75 1.00 1.25 0.25 =0.75 1.00 1.25 0.25 0.50 1.00 1.25 0.25 0.50 0.75 1.25 0.25 0.50 0.75 1.00 0.50 0.75 0.75 1.00 1.25 0.75 1.00 100 125 0.25 sm2 -1.00 1.25 125 0.25 0.50 1.25 0.25 0 25 0 50 0.75 0 25 0 50 0 50 0.75 1.00 134-15 24521 Sms - 35132 VLJUJUU JUTSU 13415 24521 sm3 = 35132 412 43 52354 36.75 36.00 30.00 38,00 27.75 24 25 39.75 28.75 28,00 24,00 disc= 26.75 27.25 36 25 26.75 29.00 33.00 24.75 28.75 29 25 37.75 48 00 41.00 45.00 46.75 50 25 -1.52 236 -1 08 1.01 1.22 0.73 0.10 -0.83 1.120.59 11 = 0.83 -0.14.1 49 -1.57 1.13 0.92 0.33 1.140.51 -053 0.86 0.10 1.15 0.68 -059 -2.43 0.10-2.07 0.96 -0.37 068 -1.54 -2.32-1.060 26 12 = -0.78 -1.41 -0.63 -2.37 027 -0.87 -1.22 0.29 0.56 -2.62 -1.08 -1.71 -0.560 89 2.82 345 a = 451 512 - 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 ml-( 12; 2 3; 34; 4 5; 5 1;1; m2 [ 34; 4 5; 5 1; 12; 2 3]; T3 15 1 2 3 4]: ml ml' ; m2'; m3] v ( 52 -6 10 -3) v (15; -3; 6; 2: 1) V 145:1:49) 13 - valinspace (12,36,5) 14 - v linspace (2,8,5) Command Window

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions