How do I convert a datetime array to a cell array of strings?
37 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 17 Dez. 2019
Beantwortet: MathWorks Support Team
am 2 Mär. 2020
I have an array of datetimes. How do I convert this to a cell array of strings or character vectors?
Akzeptierte Antwort
MathWorks Support Team
am 17 Dez. 2019
The best way to convert a datetime array to a cell array is to use the "cellstr" function:
For example,
>> DateStrings = {'2014-05-26';'2014-08-03'};
>> t = datetime(DateStrings,'InputFormat','yyyy-MM-dd')
>> t_cell = cellstr(t)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!