Plot time on x-axis with certain intervals

8 views (last 30 days)
Hi Matlab friends,
I want to plot a data set in which I have data of one minute intervals. However, the data set is big and I would only like to plot the the year/month/day quarterly. As it is, the time steps are in 250000 x 1 cell. I can convert them to categorical arrays but do not know how to proceed with the plotting.
Kind regards

Accepted Answer

Star Strider
Star Strider on 18 Nov 2021
Try something like this —
tdr = duration(minutes(1:250000));
tdt = datetime([2021 01 01])+tdr;
% Q1 = t(1435:1445)
y = sin(2*pi*minutes(tdr)*10/minutes(tdr(end)));
plot(tdt, y)
Make necessary changes to get the desired result.

Sign in to comment.

More Answers (0)


Find more on Data Type Identification in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by