Question: PLEASE use MATLAB banned function:find, loops, for, if while function Name: cupidStats Inputs: 1. (double) 1xN vector of doubles containing MATLAB skill levels, ranging from

PLEASE use MATLAB

banned function:find, loops, for, if while

function Name: cupidStats

Inputs:

1. (double) 1xN vector of doubles containing MATLAB skill levels, ranging from 1371-1738

2. (double) 1xN vector of doubles containing numbers of seconds to cook Minute Rice, ranging from 30-90

3. (double) 1xN vector of doubles containing Guitar Hero high scores, ranging from 0-985206

Outputs:

1. (double) The number corresponding to your love match

Topics: (masking), (comparative operators), (logical operators)

Banned Functions: find

Function Description: The three input vectors will each contain 5 values, one for each lover, with the lovers corresponding to their index position. Using these vectors, apply masks corresponding to the thresholds your lover needs to meet to have a chance at your heart. MATLAB skill (input 1) should be at least 1700 for obvious reasons. Minute rice cooking time (input 2) must be less than 60 seconds in order to demonstrate cooking aptitude. Guitar Hero high score (input 3) needs to be higher than 100,000 to maximize relationship potential. Finally, output the index of the lover who fits all three criteria!

Example:

matlabSkill = [1400 1500 1600 1700 1730]

riceTime = [90 80 70 60 50]

ghHighScore = [10 100 1000 10000 100001]

match = cupidStats(matlabSkill, riceTime, ghHighScore)

match = 5

Masking Notes:

The inputs are all guaranteed to be length 5.

It is guaranteed that only one lover meets all qualifications.

All stated input ranges are inclusive.

Hints: Think about how to get the number of your lover from a logical vector! What could you apply the final mask to?

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!