how to set x axis into hours
Mostrar comentarios más antiguos
i have problem . how to i set the x axis into hour. i have 10080 data and each one represents one minute of data. i want to represents x axis with 24 hour, how can I make like that
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 15 de Jun. de 2012
Something along the lines of:
set(gca,'xticklabel',num2cell(num2str((0:2:22)'),2)')
2 comentarios
Walter Roberson
el 15 de Jun. de 2012
Why use num2cell for that?
set(gca, 'xticklabel', cellstr( num2str((0:2:22).') ) )
However, this has the problem that you need exactly the matching number of Xtick values
Sean de Wolski
el 15 de Jun. de 2012
CELLSTR is sweet (and new to me!). I'd heard of ISCELLSTR, but not CELLSTR.
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!