How to convert one column from string to datetime
Ältere Kommentare anzeigen
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 Kommentare
Stephen23
am 18 Feb. 2024
"How can I fix my code?"
Please upload your data in a MAT file by clicking the paperclip button.
Dyuman Joshi
am 18 Feb. 2024
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!