How to draw a combination curve from data points of two curves with same axes ?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
cloudy snow
el 21 de Ag. de 2018
Comentada: cloudy snow
el 25 de Ag. de 2018
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.
0 comentarios
Respuesta aceptada
Adam Danz
el 21 de Ag. de 2018
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 comentarios
Adam Danz
el 23 de Ag. de 2018
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!