drawing a point in the graph

3 visualizaciones (últimos 30 días)
Ismita
Ismita el 6 de Dic. de 2022
Comentada: Ismita el 7 de Dic. de 2022

Respuestas (2)

Arif Hoq
Arif Hoq el 6 de Dic. de 2022
Editada: Arif Hoq el 6 de Dic. de 2022
x = 1:5;
y = 20:24;
plot(x,y,x(3),y(3),'*') % specify a marker symbol * in index 3 of y
please follow this for more information about plot
  3 comentarios
Arif Hoq
Arif Hoq el 7 de Dic. de 2022
try this approach. I am not sure about his efficiency.
t1 = 0:0.5:2;
x1 = t1/2-1;
t2 = 2:0.5:20;
x2 = t2 - sqrt(2*t2);
t3 = 0:0.5:1;
x3 = t3+1;
t4 = 1:0.5:11.6;
x4 = 2*sqrt(t4);
figure(1)
[x1equality ia]=find(ismember(t1,t2));
[x3equality ib]=find(ismember(t3,t4));
plot(x1, t1, 'b', x2, t2, 'r', x3, t3, 'k', x4, t4, 'g',x1(ia),t1(ia),'*',x3(ib),t3(ib),'*')
Ismita
Ismita el 7 de Dic. de 2022
Thank you :)

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 6 de Dic. de 2022
x = 0:0.5:10;
t = (x/2).^2;
abs(x-2*sqrt(t)) %cross-check weether x == 2*sqrt(t)
ans = 1×21
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
plot(x, t, '*-')
  5 comentarios
Walter Roberson
Walter Roberson el 7 de Dic. de 2022
plot(6.78233, 11.66, 'r*')
It does not matter if there is no exact match for this in the curves, if it is the correct intersection point.
Unless, that is, what you want to do is find the closest point on each of the two curves and mark those close points rather than the intersection point?
Ismita
Ismita el 7 de Dic. de 2022
thank you :)

Iniciar sesión para comentar.

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by