How do I convert a datetime array to a cell array of strings?
40 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 17 de Dic. de 2019
Respondida: MathWorks Support Team
el 2 de Mzo. de 2020
I have an array of datetimes. How do I convert this to a cell array of strings or character vectors?
Respuesta aceptada
MathWorks Support Team
el 17 de Dic. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Dates and Time 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!