Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please write the function in MATLAB(only) Problem 5. Write a function called is_between that takes three vectors of the same length as input arguments (the
please write the function in MATLAB(only)
Problem 5. Write a function called is_between that takes three vectors of the same length as input arguments (the function does not have to check the format of the input) and returns 1 or 0 as output. If it is called like this, a - is_between (x,y, z), then a equals 1, if each element of y lies between the corresponding elements of x and z and a equals 0 otherwise. The func- tion must use a for-loop and must include either a break-statement or a return-statement to make the loop efficient. Here are four examples of the function in action: >>is between ([5 -33 91, [5.5 2 40], [6, 2.3, 41]) ans >> is_between ([5 -33 91, [4.5 -34 81, I0 -34.6 5]) ans >>is between ([5 -33 9], [5.5 3 40], [6, 2.3, 41]) ans >> is between ([5 -33 9], [5 2 401, [6, 2.3, 41]) ans Step 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