STRING writes a command string that can be used to recreate the input pz object. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: STRING writes a command string that can be used to recreate the input pz object. CALL: cmd = string(pz) M-FILE INFO: Get information about this methods by calling >> pz.getInfo('string') Get information about a specified set-plist by calling: >> pz.getInfo('string', 'set') VERSION: $Id: string.m,v 1.4 2008/09/04 15:29:31 ingo Exp $ HISTORY: 02-04-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % STRING writes a command string that can be used to recreate the input pz object. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: STRING writes a command string that can be used to recreate 0005 % the input pz object. 0006 % 0007 % CALL: cmd = string(pz) 0008 % 0009 % M-FILE INFO: Get information about this methods by calling 0010 % >> pz.getInfo('string') 0011 % 0012 % Get information about a specified set-plist by calling: 0013 % >> pz.getInfo('string', 'set') 0014 % 0015 % VERSION: $Id: string.m,v 1.4 2008/09/04 15:29:31 ingo Exp $ 0016 % 0017 % HISTORY: 02-04-2007 M Hewitson 0018 % Creation 0019 % 0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 0022 function varargout = string(varargin) 0023 0024 % Check if this is a call for parameters 0025 if utils.helper.isinfocall(varargin{:}) 0026 varargout{1} = getInfo(varargin{3}); 0027 return 0028 end 0029 0030 p = utils.helper.collect_objects(varargin(:), 'pz'); 0031 0032 cmd = ''; 0033 for j=1:numel(p) 0034 pl = plist('f', p(j).f, 'q', p(j).q); 0035 0036 cmd = [cmd 'pz(' string(pl) ') ']; 0037 end 0038 0039 %%% Wrap the command only with brackets if the there are more than one object 0040 if numel(p) > 1 0041 cmd = ['[' cmd(1:end-1) ']']; 0042 end 0043 0044 % set output 0045 varargout{1} = cmd; 0046 end 0047 0048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0049 % Local Functions % 0050 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0051 0052 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0053 % 0054 % FUNCTION: getInfo 0055 % 0056 % DESCRIPTION: Get Info Object 0057 % 0058 % HISTORY: 11-07-07 M Hewitson 0059 % Creation. 0060 % 0061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0062 0063 function ii = getInfo(varargin) 0064 if nargin == 1 && strcmpi(varargin{1}, 'None') 0065 sets = {}; 0066 pl = []; 0067 else 0068 sets = {'Default'}; 0069 pl = getDefaultPlist; 0070 end 0071 % Build info object 0072 ii = minfo(mfilename, 'pz', '', utils.const.categories.output, '$Id: string.m,v 1.4 2008/09/04 15:29:31 ingo Exp $', sets, pl); 0073 end 0074 0075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0076 % 0077 % FUNCTION: getDefaultPlist 0078 % 0079 % DESCRIPTION: Get Default Plist 0080 % 0081 % HISTORY: 11-07-07 M Hewitson 0082 % Creation. 0083 % 0084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0085 0086 function plo = getDefaultPlist() 0087 plo = plist(); 0088 end 0089