I have this plot

I need to make a straight vertical line at a point on x axis that the user enters and show the coordinates of the intersection of that vertical line with my plot.
How can this be done in MATLAB?
for example: the user enters 1020 then a straight vertical line will be drawn at 1020 that meets the plot at some point and the coordinates of that point will be shown somehow.
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.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.