Change the x axis in a figure with time
Afficher commentaires plus anciens
Hi all,
I have a question:
I have a figure and I want to change the x axis (which are numbers from 1 to 48) to time scale, like this:
00:00 00:30 01:00......................23:30
any ideas?
thanks
Réponses (2)
Peter Perkins
le 26 Avr 2017
Modifié(e) : Peter Perkins
le 26 Avr 2017
In MATLAB R2014b or newer, try this:
>> t = duration(0:.5:23.5,0,0,'Format','hh:mm');
>> x = rand(size(t));
>> plot(t,x)

Jan
le 26 Avr 2017
0 votes
Did you try datetick already?
1 commentaire
Nikolas Spiliopoulos
le 26 Avr 2017
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!