STRING writes a command string that can be used to recreate the input zero object. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: STRING writes a command string that can be used to recreate the input zero object. CALL: cmd = string (zero); VERSION: $Id: string.m,v 1.7 2008/02/15 17:38:59 ingo Exp $ HISTORY: 02-04-2007 Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function cmd = string(ps, varargin) 0002 % STRING writes a command string that can be used to recreate the input zero object. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: STRING writes a command string that can be used to recreate the 0007 % input zero object. 0008 % 0009 % CALL: cmd = string (zero); 0010 % 0011 % VERSION: $Id: string.m,v 1.7 2008/02/15 17:38:59 ingo Exp $ 0012 % 0013 % HISTORY: 02-04-2007 Hewitson 0014 % Creation 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 0018 VERSION = '$Id: string.m,v 1.7 2008/02/15 17:38:59 ingo Exp $'; 0019 CATEGORY = 'Helper'; 0020 0021 %%%%% 'Params' && 'Version' Call %%%%% 0022 if nargin == 2 0023 if isa(ps, 'zero') && 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 ' zero(' string(p.plist) ')']; 0044 else 0045 cmd = [cmd ' zero(' string(plist('f', p.f, 'q', p.q)) ')']; 0046 end 0047 end 0048 cmd = [cmd ']']; 0049 0050 % END