필터 지우기
필터 지우기

About draw a timestamp 2-D plot

조회 수: 1 (최근 30일)
C Zeng
C Zeng 2012년 7월 31일
Hello, I want to plot a 2-D figure, x-axis is timestamp, y-axis is some quantity. I wonder does matlab have some templates for it?
If not how to mark the x-axis as timestamp? I want to draw a discrete time, every 10 minutes a unit maybe. Thanks.

답변 (1개)

Stephanie
Stephanie 2012년 12월 31일
편집: Stephanie 2012년 12월 31일
%y=whatever data you want it to be
%x=whatever timestamp you are collecting
x=datenum(x); %you need to convert your timestamp into numeric form
plot(x,y);
datetick('x',0) %look at the support page for datetick. It will show you what matlab date numbers correspond to which formats. (ex: 0=dd:mm:yyyy HH:MM:SS)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by