Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

Question What are the advantages of a written bonus plan?

Answered: 1 week ago