Question: using matlab. please show every step Build a MATLAB user-defined function that calculates and returns two output arguments. The input arguments are x and y

 using matlab. please show every step Build a MATLAB user-defined function

using matlab. please show every step

Build a MATLAB user-defined function that calculates and returns two output arguments. The input arguments are x and y which can be scalars or vectors containing real numbers. The first output argument is the absolute difference between the two input arguments, and the second output argument is the element-wise ratio between x and y. Requirements of the function: 1) The function must generate an error message if at least one element of y is zero. The error message must indicate that "division by zero is not allowed." generated because the second element of y is zero. 2) If the input arguments are both vectors, but of different sizes, then your function must generate an error message indicating that "input arguments are of different sizes." Example: if x [2 1 -4 5], and y [3 -2], then an error message stating that input arguments are of different sizes

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!