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 !

 채택된 답변

TJ Serdinak
TJ Serdinak 2013년 6월 11일

0 개 추천

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!

댓글 수: 1

Astrolab
Astrolab 2013년 6월 12일
Thank you very much. Not only is the answer stored, but i can also use it in further calculations in the form yD(number). Unfortunately though, since it is a numerical method, i do not know in advance the number of evaluations needed thus it is a little difficult to use. It is very helpful though, thank you again!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2013년 6월 11일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by