CHAR overloads char() function for analysis objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: CHAR overloads char() function for analysis objects. CALL: c = char(ao_in); FORMAT: c = 'ao.name/ao.data.name class(ao.data) [size(ao.data.yaxis)]' POSSIBLE VALUES: ao_in = [ao2 ao3] ao_in = ao_vector ao_in = ao_matrix VERSION: $Id: char.m,v 1.4 2007/05/29 09:48:58 ingo Exp $ HISTORY: 15-02-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function varargout = char(varargin) 0002 % CHAR overloads char() function for analysis objects. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: CHAR overloads char() function for analysis objects. 0007 % 0008 % CALL: c = char(ao_in); 0009 % 0010 % FORMAT: c = 'ao.name/ao.data.name class(ao.data) [size(ao.data.yaxis)]' 0011 % 0012 % POSSIBLE VALUES: ao_in = [ao2 ao3] 0013 % ao_in = ao_vector 0014 % ao_in = ao_matrix 0015 % 0016 % VERSION: $Id: char.m,v 1.4 2007/05/29 09:48:58 ingo Exp $ 0017 % 0018 % HISTORY: 15-02-07 M Hewitson 0019 % Creation 0020 % 0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0022 0023 %% store the input ao's in the vector: ao_set 0024 ao_set = []; 0025 for i=1:nargin 0026 a = varargin{i}; 0027 if isa(a, 'ao') 0028 [m,n] = size(a); 0029 0030 for i = 1:m 0031 for j = 1:n 0032 ao_set = [ao_set a(i,j)]; 0033 end 0034 end 0035 0036 end 0037 end 0038 0039 %% go through analysis objects 0040 for j=1:length(ao_set) 0041 0042 a = ao_set(j); 0043 0044 pstr = []; 0045 pstr = [pstr a.name]; 0046 0047 % examine data object 0048 d = a.data; 0049 dinfo = whos('d'); 0050 pstr = [pstr '/' d.name]; 0051 0052 % get data type 0053 if isempty(d) 0054 pstr = [pstr ' ' 'None']; 0055 else 0056 pstr = [pstr ' ' dinfo.class]; 0057 end 0058 0059 [x,y] = get_xy_axis(a.data); 0060 0061 xinfo = whos('y'); 0062 pstr = [pstr ' ' sprintf('[%d %d]', xinfo.size(1), xinfo.size(2)) ]; 0063 0064 % get data time 0065 0066 pstr = strrep(pstr, '_', '\_'); 0067 0068 varargout{j} = pstr; 0069 0070 end 0071 0072 % END