Change a character array to time

1 view (last 30 days)
Yongmin
Yongmin on 25 Dec 2014
Commented: Yongmin on 25 Dec 2014
Hello, I want to change the character array such as '113203' to time(hr:min:sec) 11 hours 32 minutes and 03 seconds. Would you please inform me of how to do it? Thanks in advance and happy Christmas!

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 25 Dec 2014
Edited: Azzi Abdelmalek on 25 Dec 2014
s='113203'
a=datenum(s,'HHMMSS')
out=datestr(out,'HH:MM:SS')
  1 Comment
Yongmin
Yongmin on 25 Dec 2014
Many thanks for your prompt answer. Happy Christmas!

Sign in to comment.

More Answers (0)

Categories

Find more on Christmas / Winter in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!