Question: Please do it in matlab Write a MATLAB Function my fun that takes as its only input a vector of die va e range [1,

 Please do it in matlab Write a MATLAB Function my funPlease do it in matlab

Write a MATLAB Function my fun that takes as its only input a vector of die va e range [1, 6) vals and then sets its output variable to (returns) a number between 1 and 4 based on the following criteria . 1: if all the values are the same . 2: if the values can be arranged to form a consecutive sequence . 3: if all the values equal one of three unique values 4: none of the above Sample call(): CALL 1: my-fun ( [2 2 2)) % would evaluate to 1 CALL 2 my-fun ( [2 5 6 2 5 2) % would evaluate to 3 CALL 3 my-fun ( [2 5 3 4 1)) % would evaluate to 2

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!