One way to do this is to use the GINPUT function to graphically select a point using the mouse. Assuming the data you plotted is stored in a variable data
, the following code should do the sort of thing you want.
set(gca,'XLimMode','manual','YLimMode','manual'); % Fix axes limits
hold on;
[x,y] = ginput(1); % Select a point with the mouse
x = round(x); % Round x to nearest integer value
y = data(x); % Get y data of intersection
plot([x x],get(gca,'YLim'),'k--'); % Plot dashed line
plot(x,y,'r*'); % Mark intersection with red asterisk
disp('Intersection coordinates:');
disp([x y]); % Display the intersection point
The above assumes that the x-values of the graph are just indices into the array of data you're plotting, which appears to be the case from the graph you show above.
gnovice
2009-10-04 17:16:52