LENGTH overloads the length operator for Analysis objects. Length of the data samples. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: LENGTH overloads the length operator for Analysis objects. Number of data samples in the analysis object. LENGTH(ao) is the length of the elements of ao.data. CALL: l = len(ao_in); POSSIBLE VALUES: ao_in = [ao2 ao3] ao_in = ao_vector ao_in = ao_matrix VERSION: $Id: len.html,v 1.1 2007/06/08 14:15:02 hewitson Exp $ HISTORY: 24-04-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function l = len(varargin) 0002 % LENGTH overloads the length operator for Analysis objects. Length of the data samples. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: LENGTH overloads the length operator for Analysis objects. 0007 % Number of data samples in the analysis object. 0008 % LENGTH(ao) is the length of the elements of ao.data. 0009 % 0010 % CALL: l = len(ao_in); 0011 % 0012 % POSSIBLE VALUES: ao_in = [ao2 ao3] 0013 % ao_in = ao_vector 0014 % ao_in = ao_matrix 0015 % 0016 % VERSION: $Id: len.html,v 1.1 2007/06/08 14:15:02 hewitson Exp $ 0017 % 0018 % HISTORY: 24-04-07 M Hewitson 0019 % Creation 0020 % 0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0022 0023 l = []; 0024 0025 %% store the input ao's in the vector: ao_set 0026 ao_set = []; 0027 for i=1:nargin 0028 a = varargin{i}; 0029 if isa(a, 'ao') 0030 [m,n] = size(a); 0031 0032 for i = 1:m 0033 for j = 1:n 0034 ao_set = [ao_set a(i,j)]; 0035 end 0036 end 0037 0038 end 0039 end 0040 0041 %% go through analysis objects 0042 for j=1:length(ao_set) 0043 0044 a = ao_set(j); 0045 0046 [x,y] = get_xy_axis(a.data); 0047 0048 ld = length(y); 0049 0050 l = [l ld]; 0051 end 0052 end 0053 0054 % END