


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.m,v 1.5 2008/01/03 15:33:48 ingo Exp $
HISTORY: 02-04-2007 M Hewitson
Creation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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.m,v 1.5 2008/01/03 15:33:48 ingo Exp $ 0012 % 0013 % HISTORY: 02-04-2007 M Hewitson 0014 % Creation 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 0018 VERSION = '$Id: string.m,v 1.5 2008/01/03 15:33:48 ingo Exp $'; 0019 0020 %%%%% 'Params' && 'Version' Call %%%%% 0021 if nargin == 2 0022 if isa(ps, 'pole') && ischar(varargin{1}) 0023 in = varargin{1}; 0024 if strcmp(in, 'Params') 0025 cmd = plist(); 0026 return 0027 elseif strcmp(in, 'Version') 0028 cmd = VERSION; 0029 return 0030 end 0031 end 0032 end 0033 0034 cmd = '['; 0035 for j=1:length(ps) 0036 p = ps(j); 0037 0038 pl = plist(); 0039 fields = fieldnames(p); 0040 for ii = 1:length(fields) 0041 field = fields{ii}; 0042 if strcmp(field, 'ri') 0043 % do not add this field to the parametr list 0044 else 0045 pl = append(pl, field, p.(field)); 0046 end 0047 end 0048 0049 cmd = [cmd ' pole(' string(pl) ')']; 0050 end 0051 cmd = [cmd ']']; 0052 0053 % END