DEMUX splits the input vector of AOs into a number of output AOs. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: DEMUX splits the input vector of AOs into a number of output AOs. CALL: [a1,a2,...] = demux(as) VERSION: $Id: demux.html,v 1.14 2008/03/31 10:27:33 hewitson Exp $ The following call returns a parameter list object that contains the default parameter values: >> pl = demux(ao, 'Params') The following call returns a string that contains the routine CVS version: >> version = demux(ao,'Version') The following call returns a string that contains the routine category: >> category = demux(ao,'Category') HISTORY: 28-03-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function varargout = demux(as, params) 0002 % DEMUX splits the input vector of AOs into a number of output AOs. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: DEMUX splits the input vector of AOs into a number of output AOs. 0007 % 0008 % CALL: [a1,a2,...] = demux(as) 0009 % 0010 % VERSION: $Id: demux.html,v 1.14 2008/03/31 10:27:33 hewitson Exp $ 0011 % 0012 % The following call returns a parameter list object that contains the 0013 % default parameter values: 0014 % 0015 % >> pl = demux(ao, 'Params') 0016 % 0017 % The following call returns a string that contains the routine CVS version: 0018 % 0019 % >> version = demux(ao,'Version') 0020 % 0021 % The following call returns a string that contains the routine category: 0022 % 0023 % >> category = demux(ao,'Category') 0024 % 0025 % HISTORY: 28-03-07 M Hewitson 0026 % Creation 0027 % 0028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0029 0030 VERSION = '$Id: demux.html,v 1.14 2008/03/31 10:27:33 hewitson Exp $'; 0031 CATEGORY = 'Helper'; 0032 0033 %% Check if this is a call for parameters 0034 if nargin == 2 0035 if isa(as, 'ao') && ischar(params) 0036 in = char(params); 0037 if strcmp(in, 'Params') 0038 varargout{1} = getDefaultPL(); 0039 return 0040 elseif strcmp(in, 'Version') 0041 varargout{1} = VERSION; 0042 return 0043 elseif strcmp(in, 'Category') 0044 varargout{1} = CATEGORY; 0045 return 0046 end 0047 end 0048 end 0049 0050 %% get number of input AOs 0051 n = numel(as); 0052 0053 if nargout > n 0054 error('### too many output arguments'); 0055 elseif nargout > n 0056 error('### not enough output arguments'); 0057 end 0058 0059 for j=1:nargout 0060 % map to output AO 0061 varargout{j} = as(j); 0062 end 0063 0064 %% Get default params 0065 function pl_default = getDefaultPL() 0066 0067 pl_default = plist(); 0068 0069 % END