WHY CAN'T I PLOT THIS WITH "DATETIME"?

7 visualizaciones (últimos 30 días)
Pul
Pul el 20 de Jul. de 2021
Comentada: Star Strider el 21 de Jul. de 2021
Hello everyone,
I can't plot because of the error with "data time".
Does anyone know how I can solve this problem.
Thank you.

Respuesta aceptada

Star Strider
Star Strider el 20 de Jul. de 2021
The first column is not a valid datetime array. It first needs to be converted to one.
Try this —
LD = load('LARSEN_MMEQ1.mat');
LARSENMMEQ1 = LD.LARSENMMEQ1;
LARSENMMEQ1.Var1 = datetime(LARSENMMEQ1.Var1, 'InputFormat','MM/dd/yyyy');
x = LARSENMMEQ1.Var1;
y = LARSENMMEQ1.Var2;
figure
plot(x, y)
grid
producing —
.
  8 comentarios
Pul
Pul el 21 de Jul. de 2021
Thank you very much.
You've been very kind.
Star Strider
Star Strider el 21 de Jul. de 2021
As always, my pleasure!
.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by