convert a time series into a real time animated plot
이전 댓글 표시
I am trying, with no success to display a plot of the attached timeseries in a way that it shows like if it was a real-time plotting.
Any help?
Thanks in advance
채택된 답변
추가 답변 (2개)
Voss
2022년 3월 26일
Here's one way:
load('timeseries.mat')
figure();
my_line = line();
for ii = 1:numel(time2.Time)
set(my_line,'XData',time2.Time(1:ii),'YData',time2.Data(1:ii));
drawnow();
end
Walter Roberson
2022년 3월 26일
Times = time2.Time;
Data = time2.Data;
N = 10; %at a time -- one at a time is very slow
nsamp = length(Times);
h = animatedline();
for K = 1 : N : nsamp
idx = K : min(K+N-1, nsamp);
addpoints(h, Times(idx), Data(idx));
drawnow();
end
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!