Question: On Matlab Consider a vector u, the elements of which are integers and all numbers are DIFFERENT. For example u = [-2,16,4,-12,123,5,-1,-8,51]. The same holds

On Matlab Consider a vector u, the elements of which are integers and all numbers are DIFFERENT. For example u = [-2,16,4,-12,123,5,-1,-8,51]. The same holds for a vector v. It is given that these vectors have at least one element in common, i.e. at least one element of u has the same value as an element of v, but their indices could be DIFFERENT!

i) Define a function with input u and v, and as output (in this order): -The minimum of the numbers that are in common, -The NUMBER specifying how many elements that they have in common. Note the following conditions: -The ONLY standard routine that can be used is length, -The function must NOT display (any) result

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!