The answer to this depends on what you draw. If you create a function that you can do:
>> fplot (@sin, [0 2])
>> hold on
>> plot (1.2345, sin (1.2345), 'ro')

If you are drawing a vector, use INTERP1 to interpolate the data into the target x value:
>> x = 0: .1: 2;
>> y = sin (x);
>> figure
>> plot (x, y, '.-')
>> yi = interp1 (x, y, 1.2345)
yi =
0.942913175277465
>> hold on
>> plot (1.2345, yi, 'ro')

source
share