Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sample Run I'm in CreateNew_M function. I'm in CreateMatrix_sum function. I'm in PrintMatrix function. The M1 matrix contains uniform random numbers from 1-10 16 7

image text in transcribed

image text in transcribedimage text in transcribed

Sample Run I'm in CreateNew_M function. I'm in CreateMatrix_sum function. I'm in PrintMatrix function. The M1 matrix contains uniform random numbers from 1-10 16 7 107 869310 51 453 83 1106 1053110 The M2 matrix contains uniform random numbers 5-12 6611 8 10 98 1078 10 8 7 10 11 10 8986 887810 The first and last columns of the M1 matrix 17 810 53 86 10 10 The 2nd, 4th and 5th rows of the M2 matrix 98 1078 10 8986 88 78 10 1. Use seed 7. 2. 3. 4. Create a 5x5 matrix containing numbers 1-10 using either randi(), store it in Mi variable. Create a 5x5 matrix containing numbers 5-12 using either rand(), store it in M2 variable. Call CreateNew_M function, use M1 and M2 as the input parameters, and store the returned value in a variable new_M. 5. Call CreateMatrix_sum function, use M2 and new_M as the input parameters, and store the returned value in a variable matrix_sum. function, use M1, M2, new_M and matrix_sum as the input 6. parameters, no return value. CreateNew_M.m 1. Create a new function called CreateNew_M in a script file called CreateNew_M.m 2. Setup a return value called new_M, and two input arguments called M1 and M2 Sample Run 4 3 Print "I'm in CreateNew M function." On the command window. Extract all rows and the 1 and 5 columns from the M1 matrix and store it in veel variable. 5. Extract all columus and the 20d 4th and 5th Iuws from the M2 matrix and store it in vec2 variable 6. Merge vecl matrix and vec2 matrix to form a new 5x5 matrix and store it in new_M variable. I'm in CreateNew_M function. I'm in Create Matrix sum function. I'm in PrintMatrix function. CreateMatrix_sum.m The M1 matrix contains uniform random numbers from 1-10 16 7 107 869310 51453 831106 10 53110 1 1 Create a new function called CreateMatrix_sum in a script file called CreateMatrix_sum.m 2 Sctup a return value called matrix_sum, and two input arguments called M2 and new_M 2 Print "I'm in CreateMatrix_sum function." On the command window. 4. Add the M2 matrix to the new_M matrix and store it in matrix_sum variable. The M2 matrix contains uniform random numbers 5-12 6611 8 10 9810 78 10871011 PrintMatrix.m 108986 8 8 7 8 10 1. Create a new function called PrintMatrix in a script file called PrintMatrix.m 2 Setup four input arguments called M1, M2, new_M and matrix_sum 3. Print "I'm in PrintMatrix function." On the command window. 4. Print all the above matrices using printf on the command window as shown in the Sample Run The first and last columns of the M1 matrix 17 810 53 86 10 10 Subrauit all the four m-files into Canvas The 2nd, 4th and Sth rows of the M2 matrix 9810 78 1089 BG 887810

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

Describe Public HRM Reforms

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago