How to identify points on a graph of multiple functions
Mostrar comentarios más antiguos
I wish to identify the point where y=0 for four functions on the same figure with a dot. I understand that interp1 can be used do this but I plotted my functions using "fplot" and it seems that Interp1 doesn't work with fplot. So how do I do this?
Here is my code;
n1= exp(1);
n2= 2.95;
n3= 3.05;
n4= pi;
figure;
f1 = @(x) n1-tan((x-(pi/4))/5);
fplot(f1,[0,8])
hold on
f2 = @(x) n2-tan((x-(pi/4))/5);
fplot(f2,[0,8])
hold on
f3 = @(x) n3-tan((x-(pi/4))/5);
fplot(f3,[0,8])
hold on
f4 = @(x) n4-tan((x-(pi/4))/5);
fplot(f4,[0,8])
grid on
title('Plot of Functions')
xlabel('Y values')
ylabel('X values')
legend('n=e','n=2.95','n=3.05','n=pi')
Using Snipping tool, this is what I want to produce

Those coloured dots such that when hovered over it displays the values.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
