How to convert one column from string to datetime
Mostrar comentarios más antiguos
Hi everyone
I have a n by 3 matrix. The second column is date in string format. I need to convert the second column to datetime format "YYYY-MM-DD" and return the other 2 columns untouched. I thought this would work but I am getting an error:
ABC(:,2) = datetime(ABC(:,2));
The error is:
Error using datetime
Input data must be a numeric array, a string array, a cell array containing character vectors,
or a char matrix.
How can I fix my code?
Thank you
4 comentarios
Stephen23
el 18 de Feb. de 2024
"How can I fix my code?"
Please upload your data in a MAT file by clicking the paperclip button.
Dyuman Joshi
el 18 de Feb. de 2024
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!