Home > classes > @ao > cat.m

cat

PURPOSE ^

CAT concatenate AOs into a vector.

SYNOPSIS ^

function b = cat(varargin)

DESCRIPTION ^

 CAT concatenate AOs into a vector.

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

 DESCRIPTION: CAT concatenate AOs into a vector.

 CALL:        a = cat(a1, a2)

 VERSION:     $Id: cat.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 = cat(ao, 'Params')

 The following call returns a string that contains the routine CVS version:

 >> version = cat(ao,'Version')

 The following call returns a string that contains the routine category:

 >> category = cat(ao,'Category')

 HISTORY: 27-03-07 M Hewitson
             Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function b = cat(varargin)
0002 % CAT concatenate AOs into a vector.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: CAT concatenate AOs into a vector.
0007 %
0008 % CALL:        a = cat(a1, a2)
0009 %
0010 % VERSION:     $Id: cat.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 = cat(ao, 'Params')
0016 %
0017 % The following call returns a string that contains the routine CVS version:
0018 %
0019 % >> version = cat(ao,'Version')
0020 %
0021 % The following call returns a string that contains the routine category:
0022 %
0023 % >> category = cat(ao,'Category')
0024 %
0025 % HISTORY: 27-03-07 M Hewitson
0026 %             Creation
0027 %
0028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0029 
0030 VERSION  = '$Id: cat.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(varargin{1}, 'ao') && ischar(varargin{2})
0036     in = char(varargin{2});
0037     if strcmp(in, 'Params')
0038       b = getDefaultPL();
0039       return
0040     elseif strcmp(in, 'Version')
0041       b = VERSION;
0042       return
0043     elseif strcmp(in, 'Category')
0044       b = CATEGORY;
0045       return
0046     end
0047   end
0048 end
0049 
0050 %% capture input variable names
0051 invars = {};
0052 for j=1:nargin
0053   iname = inputname(j);
0054   if isempty(iname) && isnumeric(varargin{j})
0055     iname = num2str(varargin{j});
0056   elseif isempty(iname) && ischar(varargin{j})
0057     iname = varargin{j};
0058   end
0059   invars = [invars cellstr(iname)];
0060 end
0061 
0062 b = [];
0063 for j=1:nargin
0064   if isa(varargin{j}, 'ao')
0065     b = [b varargin{j}];
0066   end
0067 end
0068 
0069 %% Get default params
0070 function pl_default = getDefaultPL()
0071 
0072   pl_default = plist();
0073 
0074 
0075 % END

Generated on Mon 31-Mar-2008 12:20:24 by m2html © 2003