how to use datetick?

4 次查看(过去 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')

更多回答(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