How to know if a vector lies inside two vectors

1 view (last 30 days)
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

Ameer Hamza
Ameer Hamza on 22 Nov 2020
Edited: Ameer Hamza on 22 Nov 2020
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 Graph and Network Algorithms 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!