Question: Q 4 . MATLAB Write a function which takes an integer in the range from 1 and 1 0 as its input. Your function should:

Q4. MATLAB
Write a function which takes an integer in the range from 1 and 10 as its input. Your function should:
if the number is out of range, return an error code er r=1 and a value of zero. if the number is not an integer, ret urn an error code err=2and a value of zero. if number is in range and an integer, return an error code err=0.
Use a switch structure to decide if the number is odd or even
return a value of 1 if odd and 2 if even.

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!