Home > classes > @pole > string.m

string

PURPOSE ^

STRING writes a command string that can be used to recreate the input pole object.

SYNOPSIS ^

function cmd = string(ps, varargin)

DESCRIPTION ^

 STRING writes a command string that can be used to recreate the input pole object.

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

 DESCRIPTION: STRING writes a command string that can be used to recreate the
              input pole object.

 CALL:        cmd = string(pole);

 VERSION:     $Id: string.html,v 1.14 2008/03/31 10:27:38 hewitson Exp $

 HISTORY:     02-04-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function cmd = string(ps, varargin)
0002 % STRING writes a command string that can be used to recreate the input pole object.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: STRING writes a command string that can be used to recreate the
0007 %              input pole object.
0008 %
0009 % CALL:        cmd = string(pole);
0010 %
0011 % VERSION:     $Id: string.html,v 1.14 2008/03/31 10:27:38 hewitson Exp $
0012 %
0013 % HISTORY:     02-04-2007 M Hewitson
0014 %                 Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 VERSION  = '$Id: string.html,v 1.14 2008/03/31 10:27:38 hewitson Exp $';
0019 CATEGORY = 'Helper';
0020 
0021 %%%%%   'Params' && 'Version' Call   %%%%%
0022 if nargin == 2
0023   if isa(ps, 'pole') && ischar(varargin{1})
0024     in = varargin{1};
0025     if strcmp(in, 'Params')
0026       cmd = plist();
0027       return
0028     elseif strcmp(in, 'Version')
0029       cmd = VERSION;
0030       return
0031     elseif strcmp(in, 'Category')
0032       cmd = CATEGORY;
0033       return
0034     end
0035   end
0036 end
0037 
0038 cmd = '[';
0039 for j=1:length(ps)
0040   p = ps(j);
0041 
0042   if ~isempty(p.plist) && nparams(p.plist) > 0
0043     cmd = [cmd ' pole(' string(p.plist) ')'];
0044   else
0045     cmd = [cmd ' pole(' string(plist('f', p.f, 'q', p.q)) ')'];
0046   end
0047 end
0048 cmd = [cmd ']'];
0049 
0050 % END

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