


STRING writes a command string that can be used to recreate the input pzmodel object.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: STRING writes a command string that can be used to recreate
the input pzmodel object.
CALL: cmd = string(pzmodel)
M-FILE INFO: Get information about this methods by calling
>> pzmodel.getInfo('string')
Get information about a specified set-plist by calling:
>> pzmodel.getInfo('string', 'None')
VERSION: $Id: string.m,v 1.9 2008/07/22 10:24:01 ingo Exp $
HISTORY: 02-04-2007 M Hewitson
Creation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


0001 % STRING writes a command string that can be used to recreate the input pzmodel object. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: STRING writes a command string that can be used to recreate 0005 % the input pzmodel object. 0006 % 0007 % CALL: cmd = string(pzmodel) 0008 % 0009 % M-FILE INFO: Get information about this methods by calling 0010 % >> pzmodel.getInfo('string') 0011 % 0012 % Get information about a specified set-plist by calling: 0013 % >> pzmodel.getInfo('string', 'None') 0014 % 0015 % VERSION: $Id: string.m,v 1.9 2008/07/22 10:24:01 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 %%% Get minfo objects 0031 objs = utils.helper.collect_objects(varargin(:), 'pzmodel'); 0032 0033 cmd = ''; 0034 for kk = 1:numel(objs) 0035 0036 if ~isempty(objs(kk).hist) 0037 cmd = [cmd, sprintf('pzmodel(%s), ', string(objs(kk).hist.plistUsed))]; 0038 else 0039 pl = plist(); 0040 fields = fieldnames(objs(kk)); 0041 for ii = 1:length(fields) 0042 field = fields{ii}; 0043 pl = append(pl, field, objs(kk).(field)); 0044 end 0045 0046 cmd = [cmd 'pzmodel(' string(pl) '), ']; 0047 end 0048 0049 end 0050 0051 cmd = cmd(1:end-2); 0052 0053 if numel(objs) > 1 0054 cmd = ['[' cmd ']']; 0055 end 0056 0057 varargout{1} = cmd; 0058 0059 end 0060 0061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0062 % Local Functions % 0063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0064 0065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0066 % 0067 % FUNCTION: getInfo 0068 % 0069 % DESCRIPTION: Get Info Object 0070 % 0071 % HISTORY: 11-07-07 M Hewitson 0072 % Creation. 0073 % 0074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0075 0076 function ii = getInfo(varargin) 0077 if nargin == 1 && strcmpi(varargin{1}, 'None') 0078 sets = {}; 0079 pl = []; 0080 else 0081 sets = {'Default'}; 0082 pl = getDefaultPlist; 0083 end 0084 % Build info object 0085 ii = minfo(mfilename, 'pzmodel', '', 'Helper', '$Id: string.m,v 1.9 2008/07/22 10:24:01 ingo Exp $', sets, pl); 0086 end 0087 0088 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0089 % 0090 % FUNCTION: getDefaultPlist 0091 % 0092 % DESCRIPTION: Get Default Plist 0093 % 0094 % HISTORY: 11-07-07 M Hewitson 0095 % Creation. 0096 % 0097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0098 0099 function plo = getDefaultPlist() 0100 plo = plist(); 0101 end 0102