Home > classes > @fsdata > eq.m

eq

PURPOSE ^

EQ overloads the == operator for fsdata objects.

SYNOPSIS ^

function result = eq(c1,c2)

DESCRIPTION ^

 EQ overloads the == operator for fsdata objects.

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

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

              The 'name', 'fs', 'enbw', 'xunits, 'yunits,  and data values are checked.
 
 CALL:        result = eq(c1,c2)
 
 INPUTS:      c1,c2 - input fsdata objects

 OUTPUTS:     If the two fsdata 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(c1,c2)
0002 
0003 % EQ overloads the == operator for fsdata objects.
0004 %
0005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0006 %
0007 % DESCRIPTION: EQ overloads the == operator for fsdata objects.
0008 %
0009 %              The 'name', 'fs', 'enbw', 'xunits, 'yunits,  and data values are checked.
0010 %
0011 % CALL:        result = eq(c1,c2)
0012 %
0013 % INPUTS:      c1,c2 - input fsdata objects
0014 %
0015 % OUTPUTS:     If the two fsdata 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 equality to begin with
0026 result = 1;
0027 
0028 %% Check name
0029 if ~strcmp(c1.name, c2.name)
0030   result = 0;
0031   return
0032 end
0033 
0034 %% check fs
0035 if c1.fs ~= c2.fs
0036   result = 0;
0037   return
0038 end
0039 
0040 %% check enbw
0041 if c1.enbw ~= c2.enbw
0042   result = 0;
0043   return
0044 end
0045 
0046 %% check xunits
0047 if ~strcmp(c1.xunits, c2.xunits)
0048   result = 0;
0049   return
0050 end
0051 
0052 %% check yunits
0053 if ~strcmp(c1.yunits, c2.yunits)
0054   result = 0;
0055   return
0056 end
0057 
0058 
0059 %% Check f data
0060 if length(c1.f) ~= length(c2.f)
0061   result = 0;
0062   return
0063 end
0064 
0065 if c1.f ~= c2.f
0066   result = 0;
0067   return
0068 end
0069 
0070 %% Check xx data
0071 if length(c1.xx) ~= length(c2.xx)
0072   result = 0;
0073   return
0074 end
0075 
0076 if c1.xx ~= c2.xx
0077   result = 0;
0078   return
0079 end

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