Question: Matlab code. Just need help with Set 3, please. This file starts with a line of code that generates an array of 75 random integers

 Matlab code. Just need help with Set 3, please. This file

Matlab code. Just need help with Set 3, please.

This file starts with a line of code that generates an array of 75 random integers from - 120 to +160. You will use a loop and conditional statements to sort the numbers generated as follows: Set 1 - all numbers that are negative. Set 2 - all numbers that are perfectly divisible by 5 (i.e. no remainder) Set 3 - whatever doesn't get sorted into set 1 or set 2. Note, numbers might exist in both set 1 and set 2 HINT: All of those sets might not need a conditional statement. Think about what we learned in our logic module. MATLAB has a function called ismember that returns a logical array that says whether numbers in an array exist in another array. eg. ismember(r, set1) would return a vector the length of r that has 1 for all indices in r that exist in set1. Display all of the arrays after sorting using disp statements. Precede every array with text that describes the characteristics of the set

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!