transforming minutes into time
Show older comments
let col1 contain the following values
905
990
1117
1228
1306
16
149
211
276
347
418
478
533
581
631
679
730
795
How can I transform the above values into time HH:MM. 905/60=15,08. or 15:05 o'clock and so on
Accepted Answer
More Answers (2)
Azzi Abdelmalek
on 6 May 2016
Edited: Azzi Abdelmalek
on 6 May 2016
a=[90;990;;1117;54;60]
h=fix(a/60)
m=mod(a,60)
out=arrayfun(@(x,y) [sprintf('%d',x) ':' sprintf('%d',y)],h,m,'un',0)
k=datenum(out,'HH:MM')
out=datestr(k,'HH:MM')
AA
on 6 May 2016
0 votes
Categories
Find more on Chebyshev 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!