MATLAB: Time cell (or char) inside a double array

char string double time convert

Hello, I have a 45×1 cell array, that I can convert to 45×8 char… the single cell is showing time, for example '09:45:46' ..
now, I would like to put this column as the first column of a double precision data array D.
I tried several things I was reading around, but I haven't found anything that could give me the right time as I see it here.
Some tips? Thanks

Best Answer

which matlab release do you use?
dateCells = {'09:45:46','09:45:49'}
dateString = strjoin(dateCells, sprintf('\n'))
result = textscan(dateString, '%d:%d:%d') % for integer results
result = textscan(dateString, '%f:%f:%f') % for double results