Question: HW2 i. Look up the expected syntax for the horcat command. Describe the expected inputs and outputs. ii. Write a script that does the following:

HW2 i. Look up the expected syntax for the "horcat command". Describe the expected inputs and outputs. ii. Write a script that does the following: a. Create a scalar variable and set it equal to pi. Create a row vector with integers 1 through 7. Create a 5x5 matrix where the odd rows are all zeros and the even rows are the row number. b. Change the elements on the matrix diagonal to all ones using row/column indexing C. Change the corner elements of the matrix to be -5 using linear indexing. iii. Write a script that does the following: a) Creates a 3 x 5 matrix of random numbers from 0 to 1. b) Sets the elements in the matrix >0.75 to 10 c) Sets the elements in the matrix 3 of 11 HW2 i. Look up the expected syntax for the "horcat command". Describe the expected inputs and outputs. ii. Write a script that does the following: a. Create a scalar variable and set it equal to pi. Create a row vector with integers 1 through 7. Create a 5x5 matrix where the odd rows are all zeros and the even rows are the row number. b. Change the elements on the matrix diagonal to all ones using row/column indexing C. Change the corner elements of the matrix to be -5 using linear indexing. iii. Write a script that does the following: a) Creates a 3 x 5 matrix of random numbers from 0 to 1. b) Sets the elements in the matrix >0.75 to 10 c) Sets the elements in the matrix 3 of 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
