plot for a part of x

3 vues (au cours des 30 derniers jours)
alpedhuez
alpedhuez le 11 Juil 2020
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?

Réponse acceptée

Star Strider
Star Strider le 11 Juil 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
.

Plus de réponses (0)

Catégories

En savoir plus sur Calendar dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by