Question: Begin a new script and start a new code cell for Part a ) by using % % . Use rand ( ) to create

Begin a new script and start a new code cell for Part a) by using %%. Use rand() to create an 87 matrix A of random numbers in the range 0,1. The following steps introduce some basic array
indexing and logic structures used in MATLAB Scripts
(i) In one line of code, change all the values in rows 3 and 6 of A to the number 2.
(ii) Next, use one line of code to change columns 2 through 5 of A to 3.
(iii) Next, use one line of code to change elements of A that are in an odd numbered
row and in an even numbered columns to 0.5(i.e.A(1,2),A(1,4),A(3,6)...)
(iv) Finally, use for loops and if statements to change all elements in A that are less
than 0.5 to zero.
Begin a new script and start a new code cell for

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 Programming Questions!