Error using datetime - Input data must be one numeric matrix when converting from a different date/time representation.

15 visualizaciones (últimos 30 días)
I have a 1443x1 double which is made up of time matlab serial numbers but when I try to use datetime to convert the serial numbers to the format HH:mm:ss.SSS I get the following error: "Input data must be one numeric matrix when converting from a different date/time representation." How do I convert the double to make this work? Thanks in advance!

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 18 de Jun. de 2021
Typically you would use the 'ConvertFrom' name-value pair.
Select the appropriate datatype here.
  2 comentarios
Gillian Murray
Gillian Murray el 18 de Jun. de 2021
This is what I was using: t = datetime('serialtime','ConvertFrom','datenum','Format','HH:mm:ss.SSS'); with serialtime being the 1443x1 double
Steven Lord
Steven Lord el 18 de Jun. de 2021
Don't pass in the char vector 'serialtime'. Pass in the variable serialtime.
x = 'abracadabra';
length('x') % the word 'x' is 1 character long
ans = 1
length(x) % the word stored in the variable named x is 11 characters long
ans = 11

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by