Question: Begin a new script and start a new code cell for Problem 1 by using %. Use rand to create an 8 x 7 matrix
Begin a new script and start a new code cell for Problem 1 by using %. Use rand to create an 8 x 7 matrix A of random numbers in the range [0,1]. (1) In one line of code, change rows 3 and 6 of A to two. (i) Next, use one line of code to change columns 2 through 5 of A to three. (iii) Next, use one line of code to change elements of A that are in odd numbered rows and in even numbered columns to 0.5 (i.e. A(1,2), A(1,4), A(1,6...) (iv) Finally, use for loops and if statements to change all elements in A that are less than 0.5 to zero. Hint: Do a help search on size, :, for, if
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
