Hi,
in MATLAB how do you convert date and time (dd-mm-yy mm:ss:S) into time only (mm:ss.S)?
%gives current date and time
c = clock
%convert all the hours into minutes and adding minutes to it and
remaining seconds as it is
k = [c(4)*60 + c(5) c(6)]
%printing in mm:ss format
sprintf("%d:%d",k(1),k(2))
If you have any doubts please comment and please don't dislike.
Get Answers For Free
Most questions answered within 1 hours.