how to use datetick?

3 vues (au cours des 30 derniers jours)
pruth
pruth le 12 Avr 2016
Commenté : pruth le 13 Avr 2016
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')

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 12 Avr 2016
Modifié(e) : Azzi Abdelmalek le 12 Avr 2016
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 commentaire
pruth
pruth le 13 Avr 2016
accepted .....thanks...

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by