EQ overloads the == operator for specwin objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: EQ overloads the == operator for specwin objects. The 'name' and 'psll' fields are checked, as well as the window length. CALL: result = eq(w1,w2) INPUTS: w1,w2 - input specwin objects OUTPUTS: If the two specwin 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function result = eq(w1,w2) 0002 0003 % EQ overloads the == operator for specwin objects. 0004 % 0005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0006 % 0007 % DESCRIPTION: EQ overloads the == operator for specwin objects. 0008 % 0009 % The 'name' and 'psll' fields are checked, as well as the 0010 % window length. 0011 % 0012 % CALL: result = eq(w1,w2) 0013 % 0014 % INPUTS: w1,w2 - input specwin objects 0015 % 0016 % OUTPUTS: If the two specwin objects are considered equal, result == 1, 0017 % otherwise, result == 0. 0018 % 0019 % VERSION: $Id: param.m,v 1.7 2007/08/17 11:22:11 ingo Exp $ 0020 % 0021 % HISTORY: 29-08-2007 M Hewitson 0022 % Creation 0023 % 0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0025 0026 % Assume equality to begin with 0027 result = 1; 0028 0029 %% Check name 0030 if ~strcmp(w1.name, w2.name) 0031 result = 0; 0032 return 0033 end 0034 0035 %% Check psll 0036 if w1.psll ~= w2.psll 0037 result = 0; 0038 return 0039 end 0040 0041 %% Check length 0042 if length(w1.win) ~= length(w2.win) 0043 result = 0; 0044 return 0045 end 0046