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.m,v 1.5 2007/10/23 16:30:44 ingo Exp $ The following call returns a parameter list object that contains the default parameter values: >> pl = demux(ao, 'Params') 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.m,v 1.5 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 = demux(ao, 'Params') 0016 % 0017 % HISTORY: 28-03-07 M Hewitson 0018 % Creation 0019 % 0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 0022 VERSION = '$Id: demux.m,v 1.5 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(as, 'ao') && ischar(params) 0027 in = char(params); 0028 if strcmp(in, 'Params') 0029 varargout{1} = getDefaultPL(); 0030 return 0031 elseif strcmp(in, 'Version') 0032 varargout{1} = VERSION; 0033 return 0034 end 0035 end 0036 end 0037 0038 %% get number of input AOs 0039 n = numel(as); 0040 0041 if nargout > n 0042 error('### too many output arguments'); 0043 elseif nargout > n 0044 error('### not enough output arguments'); 0045 end 0046 0047 for j=1:nargout 0048 % map to output AO 0049 varargout{j} = as(j); 0050 end 0051 0052 %% Get default params 0053 function pl_default = getDefaultPL() 0054 0055 pl_default = plist(); 0056 0057 % END