Answered step by step
Verified Expert Solution
Link Copied!
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

image text in transcribed

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

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students explore these related Databases questions