MATLAB: Converting hh:mm:ss into seconds

hh:mm:ss into ss

Hi all,
I want to read the vectors which are hh:mm:ss (14:35:59.812) format and convert it to seconds. How can I do this in matlab?
Best

Best Answer

Is this what you are looking for?
t='14:35:59.812';
[Y, M, D, H, MN, S] = datevec(t);
H*3600+MN*60+S