How to extract data from a plot?

I got a velocity plot from the acceleration and duration, shown as above. The code is shown as below.
Filename='cycles_ece'
U=xlsread(Filename, 'Table 1');
a_u=U(1:18,4);
t_u=U(1:18,6);
E=xlsread(Filename, 'Table 2');
a_e=E(1:18,4);
t_e=E(1:18,6);
a=[a_u;a_u;a_u;a_u;a_e];
delt=[t_u;t_u;t_u;t_u;t_e];
v=zeros(size(a));
t=zeros(size(delt));
x=-zeros(size(a))
n=numel(a);
for i=1:n
if i==1
v(i)=a(i).*delt(i);
t(i)=delt(i);
else
v(i)=(v(i-1)+a(i).*delt(i));
t(i)=t(i-1)+delt(i);
end
end
plot(t,v)
grid
xlabel('time s')
ylabel('velocity)
Now I want to get the velocity value of every second, i.e. about 1200 points.
So how could I get those values?
Many thanks.

回答 (1 件)

Alex
Alex 2015 年 7 月 8 日
編集済み: Alex 2015 年 7 月 8 日

0 投票

If you have the handle available, you can access the data using the XData and YData properties.

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

製品

質問済み:

2015 年 7 月 8 日

編集済み:

2015 年 7 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by