view toolboxes/bioakustik_tools/conversion/s_to_hhmmss.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
line wrap: on
line source
function out = s_to_hhmmss(in)
%input: time in s (integer)
%output: string in hhmmss format

hours = div(in,3600);
mins = div(mod(in,3600),60);
secs = mod(in,60);

out = strcat(tostr(hours),tostr(mins),tostr(secs));


function u=tostr(v)
if(v<10)
    u=sprintf('0%d',v);
else
     u=sprintf('%d',v);
end

function u=div(v,w)
u=(floor(v/w));