MUX concatonate AOs into a vector. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: MUX concatonate AOs into a vector. CALL: ao_vec = mux(a1 ,a2); VERSION: $Id: mux.m,v 1.4 2007/10/23 16:30:44 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: ao_vec = mux(a1 ,a2); 0009 % 0010 % VERSION: $Id: mux.m,v 1.4 2007/10/23 16:30:44 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 VERSION = '$Id: mux.m,v 1.4 2007/10/23 16:30:44 ingo Exp $'; 0023 0024 %% Check if this is a call for parameters 0025 if nargin == 2 0026 if isa(varargin{1}, 'ao') && ischar(varargin{2}) 0027 in = char(varargin{2}); 0028 if strcmp(in, 'Params') 0029 b = getDefaultPL(); 0030 return 0031 elseif strcmp(in, 'Version') 0032 b = VERSION; 0033 return 0034 end 0035 end 0036 end 0037 0038 %% capture input variable names 0039 invars = {}; 0040 for j=1:nargin 0041 iname = inputname(j); 0042 if isempty(iname) && isnumeric(varargin{j}) 0043 iname = num2str(varargin{j}); 0044 elseif isempty(iname) && ischar(varargin{j}) 0045 iname = varargin{j}; 0046 end 0047 invars = [invars cellstr(iname)]; 0048 end 0049 0050 b = []; 0051 for j=1:nargin 0052 if isa(varargin{j}, 'ao') 0053 b = [b varargin{j}]; 0054 end 0055 end 0056 0057 %% Get default params 0058 function pl_default = getDefaultPL() 0059 0060 pl_default = plist();