MATLAB: Specific values of a plot

differential equationsode45plot

I have an *.m file that solves a 2nd order differential equation numerically (using ode45) and also i have it plotted [plot(t,x(:,1))].
Is there any way i can call for some specific values of the plot like for example the speed or position for t=1 sec ?
Thanks in advance !

Best Answer

You can use the handle to each line on your plot to obtain the XData and YData as follows.
Test = line(...); or Test = plot(...) xD = get(Test,'XData'); yD = get(Test,'YData');
This will give you exact numbers for the lines on your plot.
Hope this helps!
Related Question