How to convert data points to time

6 Ansichten (letzte 30 Tage)
Nurhidayah Zainol
Nurhidayah Zainol am 21 Dez. 2020
Beantwortet: Steven Lord am 22 Dez. 2020
Hi, so I have this data and I want to convert the x-axis to time. Right now the x-axis represents the data point. Please help.

Akzeptierte Antwort

Steven Lord
Steven Lord am 22 Dez. 2020
Make a datetime or duration array and call plot with that as the first data input.
v = 1:10;
x = datetime('today')+days(v);
y = v.^2;
plot(x, y)
t = hours(v);
plot(t, y)

Weitere Antworten (0)

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by