Getting the lower/upper bound of several plots

1 view (last 30 days)
Hi,
my problem is not very hard, yet I'm posting it, in order to find a elegant solution. My current one is rather unelegant and "brute force"-ish ;)
So, here is the problem: I have several data vectors Y1, Y2, ..., Yn that are plotted. Note that each data vector may have different x-vectors X1, X2, ...., Xn.
Example:
X1 = [1 3 5 7 9 11];
Y1 = [10 7 5 6 5 4];
X2 = [2 4 6 8 10];
Y2 = [20 10 5 2.5 1.25];
X3 = [1 2 6 7 9 10];
Y3 = [11 9 4 2 2 2];
plot(X1, Y1, X2, Y2, X3, Y3); % that's what I got.
What I want is the lower bound of all these three plots in one plot. The problem here is that the vectors X1 are different. Example: Y3 has at X3 = 2 the value 9. Yet its not the lower bound, because interpolating X1 and Y1 linearly, we get Y1 is 8.5 at 2.
My current approach is to simply interpolate all values to a very fine grid and then take the minimum. Does anyone have a better idea?

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!