How do I convert a datetime array to a cell array of strings?
조회 수: 45 (최근 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!