Home > RPSstuff > hms2h.m

hms2h

PURPOSE ^

HMS2H: converts hours, minutes, and seconds to hours

SYNOPSIS ^

function [hours]=hms2h(h,m,s);

DESCRIPTION ^

 HMS2H: converts hours, minutes, and seconds to hours

  Usage:  [hours]=hms2h(h,m,s);   or [hours]=hms2h(hhmmss);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [hours]=hms2h(h,m,s);
0002 % HMS2H: converts hours, minutes, and seconds to hours
0003 %
0004 %  Usage:  [hours]=hms2h(h,m,s);   or [hours]=hms2h(hhmmss);
0005 %
0006 if nargin== 1,
0007    hms=h;
0008    h=floor(hms/10000);
0009    ms=hms-h*10000;
0010    m=floor(ms/100);
0011    s=ms-m*100;
0012    hours=h+m/60+s/3600;
0013 else
0014    hours=h+(m+s/60)/60;
0015 end

Generated on Wed 30-Nov-2005 14:45:02 by m2html © 2003