plot for a part of x

1 次查看(过去 30 天)
alpedhuez
alpedhuez 2020-7-11
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?

采纳的回答

Star Strider
Star Strider 2020-7-11
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 个)

类别

Help CenterFile Exchange 中查找有关 Calendar 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by