MATLAB: How to draw a combination curve from data points of two curves with same axes

a curve from two curves

i have data points of two curves with same axes to be drawn in MATLAB. Morever, I need to draw one more curve using all data points of previous two curves with same axes. How can i draw the third curve using all data points of the first two curves? and then, how to find the lowest point of the third curve? I want all of three curves are on one figure. Please give me suggestion.

Best Answer

If your two curves are stored as vectors in variables x1, y1, x2, y2, and you've plotted
figure
plot(x1,y1)
hold on
plot(x2,y1)
then to combine (x1,y1) and (x2,y2) into a 3rd curve,
x3 = [x1, x2]; %for row vectors; if column vecs, [x1;x2]
y3 = [y1, y2];
plot(x3,y3)
The lowest point along the y axis in curve #3 is
[minVal, minIdx] = min(y3)