comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function out = s_to_hhmmss(in)
2 %input: time in s (integer)
3 %output: string in hhmmss format
4
5 hours = div(in,3600);
6 mins = div(mod(in,3600),60);
7 secs = mod(in,60);
8
9 out = strcat(tostr(hours),tostr(mins),tostr(secs));
10
11
12 function u=tostr(v)
13 if(v<10)
14 u=sprintf('0%d',v);
15 else
16 u=sprintf('%d',v);
17 end
18
19 function u=div(v,w)
20 u=(floor(v/w));