plot for a part of x
3 views (last 30 days)
Show older comments
I have a plot for the date from 2001 to 2020. I now just want to plot for the data between 2019 and 2020. What will be a simpler way to do this?
0 Comments
Accepted Answer
Star Strider
on 11 Jul 2020
Experiment witth this example:
dt = datetime([2001 01 01])+calmonths(0:(2021-2001)*12); % ‘datetime’ Vector
y = rand(size(dt)); % Random Vector
figure
plot(dt,y)
xlim([datetime([2019 01 01]) datetime([2020 12 31])]) % Define Plot Limits
.
0 Comments
More Answers (0)
See Also
Categories
Find more on Calendar 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!