Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 sizesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started