Change data type of a table column into datetime?
44 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Julozert
el 27 de Mayo de 2020
Comentada: Mohammad Zaheer Hussein Suhabuth
el 21 de Oct. de 2022
Hi,
I have read a table with readtable and changed my the column with the time data to a char using detectImportOptions-function.
I now wanna change the data type from char to datetime but it doesnt work. How do i need to do it?
0 comentarios
Respuestas (2)
Eric Sofen
el 9 de Jun. de 2020
Take a look at the convertvars function for changing the data type of a table variable.
Also, is there a reason you're bring in the time data as char rather than directly as datetime or duration from readtable?
0 comentarios
Drishti Jain
el 28 de Mayo de 2020
You can use datetime: https://in.mathworks.com/help/matlab/ref/datetime.html
e.g-
tm='10:14:25'
new_tm= datetime(tm,'Format','HH:mm:ss')
1 comentario
Ver también
Categorías
Más información sobre Tables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!