dates in x axis plot

20 views (last 30 days)
Fabio Ambrosini
Fabio Ambrosini on 24 Jun 2021
Answered: KSSV on 24 Jun 2021
I have a string vector of Dates and a vector of values that correspond to the y value. I want to have dates in x axis on the plot, how con I do?

Accepted Answer

KSSV
KSSV on 24 Jun 2021
Convert your date into class datetime you can striaght away use plot.
t = datetime(2021,1,1):datetime(2021,12,31) ;
y = rand(size(t)) ;
plot(t,y)

More Answers (0)

Categories

Find more on Dates and Time in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!