How to know if a vector lies inside two vectors

How to write the code to see if the blue graph is between two other graphs. If the vector is in two it will show 1, if not 0.

 Accepted Answer

Try this
x_low; % lower line in red
x_upper; % upper line in red
y; % line in blue
tf = all((x_low<=y)&(y<=x_high))

More Answers (0)

Categories

Find more on Graphics Objects in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!