You can use the cellstr()
function in MATLAB to convert a datetime array to a cell array of strings.
Here's an example code snippet that demonstrates this:
main.m184 chars9 lines
Output:
main.m102 chars5 lines
You can modify the date format using the datestr()
function, as shown in the example below:
main.m180 chars6 lines
Output:
main.m99 chars5 lines
Note that the size of the resulting cell array will be the same as the size of the original datetime array.
gistlibby LogSnag