Home > classes > @time > isequal.m

isequal

PURPOSE ^

SYNOPSIS ^

function res = isequal(tt1, tt2)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function res = isequal(tt1, tt2)
0002 
0003 
0004 if nargin < 2 || ~isa(tt1, 'time') || ~isa(tt2, 'time')
0005   error (['### The two inputs must be a time object. ' char(10) char(10) ...
0006           'Use: res = isequal(a1.data.time, a2.data.time).'])
0007 end
0008 
0009 fields = fieldnames(tt1);
0010 
0011 for ii=1:length(fields)
0012   field = fields{ii};
0013   
0014   ret   = isequal(tt1.(field), tt2.(field));
0015 
0016   res.(field) = ret;
0017   
0018   if ~isstruct(ret) && ~ret
0019     if ischar (tt1.(field))
0020       disp(['TIME: ' field ' : ' tt1.(field) ' <-> ' tt2.(field)]);
0021     elseif isnumeric (tt1.(field)) && length (tt1.(field)) > 1
0022       disp(['TIME: data field ''' field ''' is not equal']);
0023     elseif isnumeric (tt1.(field))
0024       disp(['TIME: ' field ' : ' num2str(tt1.(field)) ' <-> ' num2str(tt2.(field))]);
0025     else
0026       disp(['TIME: ' field ' : ']);
0027     end
0028   end
0029 
0030 end

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