How to turn datapoints into hours?

1 次查看(过去 30 天)
I have 200 datapoints which I need to turn into 50 hours, trying to replicate the picture attached. What is the best way or function for doing this?

回答(1 个)

Walter Roberson
Walter Roberson 2018-9-2
t = (1:200)/50;
plot(t, y)
  1 个评论
Rebecca Ellis
Rebecca Ellis 2018-9-2
编辑:Rebecca Ellis 2018-9-2
Thank you for this answer - I was trying to use the date time function - as I need to see the hour when I zoom into the figure eg. picture
I was trying
ticlocs =
datetime(DateString);
ticlocs.Format = 'HH-MM';
set(gca, 'XTick', ticklocs);
But this is better- I was trying for a more automated way as I have lots of datasets at different lengths to convert to hours.

请先登录,再进行评论。

类别

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