dates in x axis plot

19 次查看(过去 30 天)
Fabio Ambrosini
Fabio Ambrosini 2021-6-24
回答: KSSV 2021-6-24
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?

采纳的回答

KSSV
KSSV 2021-6-24
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)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by