Home > classes > @ao > demux.m

demux

PURPOSE ^

DEMUX splits the input vector of AOs into a number of output AOs.

SYNOPSIS ^

function varargout = demux(as, params)

DESCRIPTION ^

 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.4 2007/06/22 08:32:49 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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

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.4 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 = demux(ao, 'Params')
0016 %
0017 % HISTORY: 28-03-07 M Hewitson
0018 %             Creation
0019 %
0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0021 
0022 ALGONAME = mfilename;
0023 VERSION  = '$Id: demux.m,v 1.4 2007/06/22 08:32:49 ingo Exp $';
0024 
0025 %% Check if this is a call for parameters
0026 if nargin == 2
0027   if isa(as, 'ao') && ischar(params)
0028     in = char(params);
0029     if strcmp(in, 'Params')
0030       varargout{1} = getDefaultPL();
0031       return
0032     end
0033   end
0034 end
0035 
0036 %% get number of input AOs
0037 si = size(as);
0038 n  = si(1)*si(2);
0039 
0040 if nargout > n
0041   error('### too many output arguments');
0042 end
0043 
0044 for j=1:nargout
0045   % map to output AO
0046   varargout{j} = as(j);
0047 end
0048 
0049 %% Get default params
0050 function pl_default = getDefaultPL()
0051 
0052 disp('* creating default plist...');
0053   pl_default = plist();
0054 disp('* done.');
0055 
0056 % END

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003