Question: MATLAB (25 points) UDF & if/else statement. Please write a User Defined Function (UDF) that has one input and no output. The input is a

MATLAB
MATLAB (25 points) UDF \& if/else statement. Please write a User Defined

(25 points) UDF \& if/else statement. Please write a User Defined Function (UDF) that has one input and no output. The input is a single scalar (integer). The function called "Evenorodd". The function doesn't have output argument but should display in a sentence if the input is (positive, negative or zero) and (even or odd) number: i.e. "23 is an odd and positive number". Use If/else statement in your function. (Note: You need to include two files: one for the UDF function, and one for the script with testing commands) i. (20 Points) Create a UDF called "Evenorodd". Few guidelines which you don't have to follow: - Syntax for function without output arguments n - You can use more than one if/else statements: L.e, one for the sign (positive or negative or zero) and another one for (even or odd). - You may use disp or frrintf or any other commands to display the sentence. - If you are to use rem function to judge if the number is even or odd, you may want to consider absolute value for negative inputs. ii. (5 Points) Show results on command window using your function, EvenorOdd, with three different inputs 0,13 , and -24. For example

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!