Question: Problem Given two equal - sized numeric arrays a and b , write a function that compares a and b element - wise, i .
Problem
Given two equalsized numeric arrays a and write a function that compares a and elementwise, ie the first element of to the first element of and the second element of to the second element of ect. If a has an equal number of or more elements greater than then the function should return a with the count of elements that are greater than those of If has more elements greater than then the function should return with the count of elements that are greater than those of
Note: The grader generates random assessment cases and above example is not the only assessment cases. You should utilize 'Code to Call Your Function' script box and thoroughly test your function with more input arguments before making a submission You can also copyandpaste the input arguments from the grader's feedback
Examples
aFunction
and
a has two elements greater than and has one element greater than
The function should return and
aFunction
and
a has zero elements greater than and has zero element greater than
The function should return and
aFunction
and
a has zero elements greater than and has four element greater than
The function should return and
Task
Write a function aFunction that takes up to two input arguments and returns two output values.
Hint
Logical arrays that are derived from relational operations are also numeric. You can use builtin functions like sum on logical arrays to count the number of s
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
