# How I can plot time on x axis with a interval of 2hrs from 0 to 24hrs

9 vues (au cours des 30 derniers jours)
Vikash Raj le 30 Sep 2021
Commenté : Vikash Raj le 4 Oct 2021
Hi.
I have a 10600 timestamp data in the form of 2015 - 01 -19T12:55:18Z which I need to plot aginst vertical total electron content. How can I remove T and Z and howI can plot time on x axis with a interval of 2hrs from 0 to 24hrs against vertical total electron content. Im very new to matlab software and Im doing a masters program to do my data analysis. Any help and suggestion will be highly appriciated.
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

Walter Roberson le 30 Sep 2021
TS = {'2015 - 01 -19T12:55:18Z', '2015 - 01 -19T23:17:29Z', }
TS = 1×2 cell array
{'2015 - 01 -19T12:55:18Z'} {'2015 - 01 -19T23:17:29Z'}
t = datetime(TS, 'inputformat', "yyyy - MM -dd'T'HH:mm:ss'Z'", 'TimeZone', 'GMT')
t = 1×2 datetime array
19-Jan-2015 12:55:18 19-Jan-2015 23:17:29
plot(t, [1 2])
##### 14 commentairesAfficher 12 commentaires plus anciensMasquer 12 commentaires plus anciens
Walter Roberson le 1 Oct 2021
Monthly... so each plot should have between 28*12 = 296 and 31*12 = 334 hour ticks ? So barely possible to make out at anything less than 1500 pixels wide ?
Vikash Raj le 4 Oct 2021
Thank you for your help and suggestions.

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Title dans Help Center et File Exchange

R2015a

### Community Treasure Hunt

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

Start Hunting!

Translated by