How do I convert a datetime array to a cell array of strings?
38 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2019 年 12 月 17 日
回答済み: MathWorks Support Team
2020 年 3 月 2 日
I have an array of datetimes. How do I convert this to a cell array of strings or character vectors?
採用された回答
MathWorks Support Team
2019 年 12 月 17 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!