MUX concatonate AOs into a vector. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: MUX concatonate AOs into a vector. CALL: VERSION: $Id: mux.m,v 1.3 2007/06/22 08:32:49 ingo Exp $ The following call returns a parameter list object that contains the default parameter values: >> pl = mux(ao, 'Params') HISTORY: 27-03-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function b = mux(varargin) 0002 % MUX concatonate AOs into a vector. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: MUX concatonate AOs into a vector. 0007 % 0008 % CALL: 0009 % 0010 % VERSION: $Id: mux.m,v 1.3 2007/06/22 08:32:49 ingo Exp $ 0011 % 0012 % The following call returns a parameter list object that contains the 0013 % default parameter values: 0014 % 0015 % >> pl = mux(ao, 'Params') 0016 % 0017 % HISTORY: 27-03-07 M Hewitson 0018 % Creation 0019 % 0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 0022 %% Check if this is a call for parameters 0023 if nargin == 2 0024 if isa(varargin{1}, 'ao') && ischar(varargin{2}) 0025 in = char(varargin{2}); 0026 if strcmp(in, 'Params') 0027 b = getDefaultPL(); 0028 return 0029 end 0030 end 0031 end 0032 0033 %% capture input variable names 0034 invars = {}; 0035 for j=1:nargin 0036 iname = inputname(j); 0037 if isempty(iname) && isnumeric(varargin{j}) 0038 iname = num2str(varargin{j}); 0039 elseif isempty(iname) && ischar(varargin{j}) 0040 iname = varargin{j}; 0041 end 0042 invars = [invars cellstr(iname)]; 0043 end 0044 0045 b = []; 0046 for j=1:nargin 0047 if isa(varargin{j}, 'ao') 0048 b = [b varargin{j}]; 0049 end 0050 end 0051 0052 %% Get default params 0053 function pl_default = getDefaultPL() 0054 0055 disp('* creating default plist...'); 0056 pl_default = plist(); 0057 disp('* done.');