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. REMARK: This is a transparent function and as such does not add history. CALL: [a1,a2,...] = demux(as) VERSION: $Id: demux.m,v 1.13 2008/09/05 11:05:29 ingo Exp $ M-FILE INFO: Get information about this methods by calling >> ao.getInfo('demux') Get information about a specified set-plist by calling: >> ao.getInfo('demux', 'None') HISTORY: 28-03-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % DEMUX splits the input vector of AOs into a number of output AOs. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: DEMUX splits the input vector of AOs into a number of output AOs. 0005 % 0006 % REMARK: This is a transparent function and as such does not add history. 0007 % 0008 % CALL: [a1,a2,...] = demux(as) 0009 % 0010 % VERSION: $Id: demux.m,v 1.13 2008/09/05 11:05:29 ingo Exp $ 0011 % 0012 % M-FILE INFO: Get information about this methods by calling 0013 % >> ao.getInfo('demux') 0014 % 0015 % Get information about a specified set-plist by calling: 0016 % >> ao.getInfo('demux', 'None') 0017 % 0018 % HISTORY: 28-03-07 M Hewitson 0019 % Creation 0020 % 0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0022 0023 function varargout = demux(varargin) 0024 0025 % Check if this is a call for parameters 0026 if utils.helper.isinfocall(varargin{:}) 0027 varargout{1} = getInfo(varargin{3}); 0028 return 0029 end 0030 0031 import utils.const.* 0032 utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename); 0033 0034 % Collect input variable names 0035 in_names = cell(size(varargin)); 0036 for ii = 1:nargin,in_names{ii} = inputname(ii);end 0037 0038 % Collect all AOs 0039 as = utils.helper.collect_objects(varargin(:), 'ao', in_names); 0040 0041 % get number of input AOs 0042 n = numel(as); 0043 if nargout > n 0044 error('### too many output arguments'); 0045 elseif nargout < n 0046 error('### not enough output arguments'); 0047 end 0048 0049 for j=1:nargout 0050 % map to output AO 0051 varargout{j} = as(j); 0052 end 0053 end 0054 0055 %-------------------------------------------------------------------------- 0056 % Get Info Object 0057 %-------------------------------------------------------------------------- 0058 function ii = getInfo(varargin) 0059 0060 if nargin == 1 && strcmpi(varargin{1}, 'None') 0061 sets = {}; 0062 pl = []; 0063 else 0064 sets = {'Default'}; 0065 pl = getDefaultPlist; 0066 end 0067 % Build info object 0068 ii = minfo(mfilename, 'ao', '', utils.const.categories.helper, '$Id: demux.m,v 1.13 2008/09/05 11:05:29 ingo Exp $', sets, pl); 0069 end 0070 0071 %-------------------------------------------------------------------------- 0072 % Get Default Plist 0073 %-------------------------------------------------------------------------- 0074 function pl = getDefaultPlist() 0075 pl = plist(); 0076 end 0077