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

2 次查看(过去 30 天)
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.

采纳的回答

Adam Danz
Adam Danz 2018-8-21
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)
  5 个评论
Adam Danz
Adam Danz 2018-8-23
Glad that helped! About your new question, it's best to write a new question on the forum rather than continuing this one since the topic is different. To partially answer the question, it depends on what type of data is being stored in the txt files. Is it strings? numerical matrices? etc.
But first just try searching for the answer because this has been addressed many times.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by