Question: Function Name: MathWorks Inputs: 1. ( double ) 1XM vector of your scores 2. ( double ) 1XN vector of your friend's scores 3. (
Function Name: MathWorks
Inputs:
1. ( double ) 1XM vector of your scores
2. ( double ) 1XN vector of your friend's scores
3. ( double ) 1XK vector of your second friend's scores
Outputs:
1. ( double ) 1X3 vector of score statistics
Topics: ( mean/median/mode ), ( sorting )
Banned Functions:
mean, median
Background:
There is only ONE correct way to do math. Luckily, the world's greatest
comedian, Tom Middleditch, can teach you how to perfect the art of math. A-boopity-boop-boop!
Function Description:
You and two friends are in a math competition, and receive scores from various judges. Your
scores are represented by the values in the first input vector. Your first friend's scores are
represented by the values in the second input vector. Your second friend's scores are
represented by the values in the third input vector.
Find the average of your scores (rounded to one decimal place), the median of your first
friend's scores, and the mode of your second friend's scores. The mean() and median()
functions are banned, so you will have to figure out how to calculate these values without the
aid of those functions. Finally, combine these three values into one vector, and sort this vector
in descending order.
Example:
myScores = [10, 9, 10]
friend1 = [1, 0, 10000, 0, -1]
friend2 = [1, 2, 1, 1000]
scoreStats = MathWorks(myScores, friend1, friend2)
scoreStats [9.7, 1, 0]
Notes:
The length of the second input is guaranteed to be odd
One value is guaranteed to appear more than the others in the third input
Please solve without using conditional statements and iterations!!!! Also do not use the median function. Please help me get the median of the vector input without using the inbuilt median function!!!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
