MATLAB: Time format as hr:min:sec

time format

sir, i have three columns- one containing hour, next minute , third on sec.
hr=[10,10,10,10];
min=[00,00,01,01];
sec=[00,30,00,30];
i need a single column of time as
[10:00:00,10:00:30,10:01:00,10:01:30]
what is the method?

Best Answer

hr=[10,10,10,10];
min=[00,00,01,01];
sec=[00,30,00,30] ;
iwant = [] ;
for i = 1:length(hr)
str = sprintf('%02d:%02d:%02d\n',hr(i),min(i),sec(i)) ;
iwant = [iwant ; str] ;
end
iwant