Home > classes > @timespan > eq.m

eq

PURPOSE ^

EQ overloads the == operator for timespan objects.

SYNOPSIS ^

function result = eq(t1,t2)

DESCRIPTION ^

 EQ overloads the == operator for timespan objects.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: EQ overloads the == operator for timespan objects.

              Start and stop times are compared.
 
 CALL:        result = eq(ts1,ts2)

 INPUTS:      ts1,ts2 - input timespan objects

 OUTPUTS:     If the two timespan objects are considered equal, result == 1,
              otherwise, result == 0.
 
 VERSION:     $Id: param.m,v 1.7 2007/08/17 11:22:11 ingo Exp $

 HISTORY:     29-08-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function result = eq(t1,t2)
0002 
0003 % EQ overloads the == operator for timespan objects.
0004 %
0005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0006 %
0007 % DESCRIPTION: EQ overloads the == operator for timespan objects.
0008 %
0009 %              Start and stop times are compared.
0010 %
0011 % CALL:        result = eq(ts1,ts2)
0012 %
0013 % INPUTS:      ts1,ts2 - input timespan objects
0014 %
0015 % OUTPUTS:     If the two timespan objects are considered equal, result == 1,
0016 %              otherwise, result == 0.
0017 %
0018 % VERSION:     $Id: param.m,v 1.7 2007/08/17 11:22:11 ingo Exp $
0019 %
0020 % HISTORY:     29-08-2007 M Hewitson
0021 %                 Creation
0022 %
0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 
0025 % Assume true
0026 result = 1;
0027 
0028 %% Check start
0029 if t1.start ~= t2.start
0030   result = 0;
0031   return
0032 end
0033 
0034 %% Check end
0035 if t1.end ~= t2.end
0036   result = 0;
0037   return
0038 end
0039 
0040 %% Check timeformat
0041 if t1.timeformat ~= t2.timeformat
0042   result = 0;
0043   return
0044 end
0045 
0046 %% Check timezone
0047 if t1.timezone ~= t2.timezone
0048   result = 0;
0049   return
0050 end

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003