Question: Create a 7 by 2 0 array filled with random numbers from the following set: - 2 , 0 , 2 , 4 . The

Create a 7 by 20 array filled with random numbers from the following set: -2,0,2,4. The name of the array should be K.
How many elements in your array are equal to 4? The answer should be assigned to N1.
How many elements in your array are less than 2? The answer should be assigned to N2.
This script should be fully vectorized. You don't have to aim for the shortest script, but the problem can be solved with three lines of code (try to achieve this to improve your skills).
HINT: you should use a relational expression to identify the elements you are interested in and then you should use a built-in function for summation.
 Create a 7 by 20 array filled with random numbers from

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