68 lines
3.7 KiB
HTML
68 lines
3.7 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||
|
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Description of sec2hms</title>
|
||
|
<meta name="keywords" content="sec2hms">
|
||
|
<meta name="description" content="function [hour, minute, second] = sec2hms(sec)">
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||
|
<meta name="generator" content="m2html © 2003 Guillaume Flandin">
|
||
|
<meta name="robots" content="index, follow">
|
||
|
<link type="text/css" rel="stylesheet" href="../m2html.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<a name="_top"></a>
|
||
|
<div><a href="../index.html">Home</a> > <a href="index.html">.</a> > sec2hms.m</div>
|
||
|
|
||
|
<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td>
|
||
|
<td align="right"><a href="index.html">Index for . <img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
|
||
|
|
||
|
<h1>sec2hms
|
||
|
</h1>
|
||
|
|
||
|
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="box"><strong>function [hour, minute, second] = sec2hms(sec)</strong></div>
|
||
|
|
||
|
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="box"><strong>function hms = sec2hms(sec) </strong></div>
|
||
|
|
||
|
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="fragment"><pre class="comment">function [hour, minute, second] = sec2hms(sec)
|
||
|
SEC2HMS Convert seconds to hours, minutes and seconds.
|
||
|
|
||
|
[HOUR, MINUTE, SECOND] = SEC2HMS(SEC) converts the number of seconds in
|
||
|
SEC into hours, minutes and seconds.</pre></div>
|
||
|
|
||
|
<!-- crossreference -->
|
||
|
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
This function calls:
|
||
|
<ul style="list-style-image:url(../matlabicon.gif)">
|
||
|
</ul>
|
||
|
This function is called by:
|
||
|
<ul style="list-style-image:url(../matlabicon.gif)">
|
||
|
</ul>
|
||
|
<!-- crossreference -->
|
||
|
|
||
|
|
||
|
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function hms = sec2hms(sec)</a>
|
||
|
0002 <span class="comment">%function [hour, minute, second] = sec2hms(sec)</span>
|
||
|
0003 <span class="comment">%SEC2HMS Convert seconds to hours, minutes and seconds.</span>
|
||
|
0004 <span class="comment">%</span>
|
||
|
0005 <span class="comment">% [HOUR, MINUTE, SECOND] = SEC2HMS(SEC) converts the number of seconds in</span>
|
||
|
0006 <span class="comment">% SEC into hours, minutes and seconds.</span>
|
||
|
0007
|
||
|
0008 <span class="comment">% Author: Peter J. Acklam</span>
|
||
|
0009 <span class="comment">% Time-stamp: 2002-03-03 12:50:09 +0100</span>
|
||
|
0010 <span class="comment">% E-mail: pjacklam@online.no</span>
|
||
|
0011 <span class="comment">% URL: http://home.online.no/~pjacklam</span>
|
||
|
0012
|
||
|
0013 hour = fix(sec/3600); <span class="comment">% get number of hours</span>
|
||
|
0014 sec = sec - 3600*hour; <span class="comment">% remove the hours</span>
|
||
|
0015 minute = fix(sec/60); <span class="comment">% get number of minutes</span>
|
||
|
0016 sec = sec - 60*minute; <span class="comment">% remove the minutes</span>
|
||
|
0017 second = sec;
|
||
|
0018 hms = [num2str(hour,<span class="string">'%02g'</span>) <span class="string">':'</span> num2str(minute,<span class="string">'%02g'</span>) <span class="string">':'</span> num2str(second,<span class="string">'%02g'</span>)];</pre></div>
|
||
|
<hr><address>Generated on Fri 16-Jun-2006 09:09:06 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address>
|
||
|
</body>
|
||
|
</html>
|