Borrar filtros
Borrar filtros

Column of dates to vector

3 visualizaciones (últimos 30 días)
Kendal
Kendal el 17 de Nov. de 2022
Comentada: Kendal el 17 de Nov. de 2022
Hey guys,
I have a table that contains dates that I would like to convert to a column of numbers (a vector), so I can do some further manipulation. When i use the following code: dateNum = datevec(date);
I get the following error:
Error using datevec (line 116)
The input to DATEVEC was not an array of character vectors or strings.
Any assistance would be greatly appreciated.
  2 comentarios
Steven Lord
Steven Lord el 17 de Nov. de 2022
By "contains dates" are you referring to a datetime array or an array of serial date numbers?
What type of manipulation do you want to do? There may be a way to perform that manipulation directly on the datetime array without having to convert to a numeric representation.
What do the numbers you want to generate represent? Number of days since a certain date and time, number of hours, number of minutes, number of seconds, etc.?
Kendal
Kendal el 17 de Nov. de 2022
Good Day,
So the date/time is in the following format: 01/18/2022 12:00:00 AM
The date/time increases in 15 min intervals.
In adjacent column there are number of people present.
I would like to find the number of people for the entire of 2017, 2018, 2019
Please let me know if anything else is required.

Iniciar sesión para comentar.

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