Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 setStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started