How to convert data points to time

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.

 Respuesta aceptada

Steven Lord
Steven Lord el 22 de Dic. de 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)

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 21 de Dic. de 2020

Respondida:

el 22 de Dic. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by