Plot continuous on time

조회 수: 2 (최근 30일)
Carlos
Carlos 2014년 3월 27일
답변: Sara 2014년 3월 28일
Hello,
I have an array that increases because a loop. I'd like to plot it on axe Y respect the time 'dd mmmm yyyy HH:MM' that the value on my last value of array. I want to have an infinite plot that will be constructing time after time.
Here is a little idea of what I want to do:
function realtime(cycles)
global t
n=0;
i=1;
Tiempo=datestr(now,'dd mmmm yyyy HH:MM');
while(n < cycles)
t(i) = rand(1);
i=i+1;
set(gcf,'color','white');
drawnow;
plot(t,'-.dk','linewidth',1.8)
grid off;
title('Example');
xlabel('Time');
ylabel('Random value');
n = n+1;
pause(0.5);
end
Thank you.

채택된 답변

Sara
Sara 2014년 3월 28일
use hold on command

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by