LTPDA_ISOBJECT checks that the input objects are one of the LTPDA object types. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: LTPDA_ISOBJECT checks that the input objects are one of the LTPDA object types. CALL: result = ltpda_isobject(a1) classes = ltpda_isobject() INPUTS: objects OUTPUTS: result == 1 if all input objects are LTPDA objects result == 0 otherwise classes - a list of recognised LTPDA object types VERSION: $Id: submit.m,v 1.14 2007/08/16 06:55:25 hewitson Exp $ HISTORY: 09-05-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function varargout = ltpda_isobject(varargin) 0002 0003 % LTPDA_ISOBJECT checks that the input objects are one of the LTPDA object 0004 % types. 0005 % 0006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0007 % 0008 % DESCRIPTION: LTPDA_ISOBJECT checks that the input objects are one of the LTPDA object 0009 % types. 0010 % 0011 % CALL: result = ltpda_isobject(a1) 0012 % classes = ltpda_isobject() 0013 % 0014 % INPUTS: objects 0015 % 0016 % OUTPUTS: result == 1 if all input objects are LTPDA objects 0017 % result == 0 otherwise 0018 % classes - a list of recognised LTPDA object types 0019 % 0020 % VERSION: $Id: submit.m,v 1.14 2007/08/16 06:55:25 hewitson Exp $ 0021 % 0022 % HISTORY: 09-05-07 M Hewitson 0023 % Creation 0024 % 0025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0026 0027 classes = {'ao',... 0028 'param',... 0029 'plist',... 0030 'cdata',... 0031 'tsdata',... 0032 'fsdata',... 0033 'xydata',... 0034 'specwin',... 0035 'mfir',... 0036 'miir',... 0037 'pzmodel',... 0038 'pole',... 0039 'zero',... 0040 'provenance',... 0041 'time',... 0042 'timeformat',... 0043 'timespan',... 0044 'history'}; 0045 0046 if nargin == 0 0047 varargout{1} = classes; 0048 else 0049 0050 for j=1:nargin 0051 % check this object 0052 obj = varargin{1}; 0053 found = 0; 0054 for k=1:length(classes) 0055 type = classes{k}; 0056 if isa(obj, type) 0057 found = 1; 0058 end 0059 end 0060 if ~found 0061 varargout{1} = 0; 0062 return 0063 end 0064 end 0065 end 0066 0067 varargout{1} = 1; 0068