how to use datetick?

조회 수: 3 (최근 30일)
pruth
pruth 2016년 4월 12일
댓글: pruth 2016년 4월 13일
hi,....i hve a file...first column is date and time second is data.file attached i using following code..it showing me error...i dont know why.and more over i want date tick at regular 3 month interval...not randomly...
x= vcdmean(:,1);
y = vcdmean(:,2);
plot(x,y,'.')
datetick('x', 'mmm YYYY')

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 12일
편집: Azzi Abdelmalek 2016년 4월 12일
q=datevec(x)
[~,ii]=unique(q(:,1:2),'rows')
a=q(ii,:)
a=a(1:3:end,:)
xt=datenum(a)
plot(x,y,'.')
set(gca,'xtick',xt)
datetick('x', 'mmm YYYY','keepticks')
  댓글 수: 1
pruth
pruth 2016년 4월 13일
accepted .....thanks...

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by