Home > classes > @pzmodel > string.m

string

PURPOSE ^

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

SYNOPSIS ^

function varargout = string(varargin)

DESCRIPTION ^

 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.10 2008/09/04 15:29:31 ingo Exp $

 HISTORY:     02-04-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

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.10 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   objs = utils.helper.collect_objects(varargin(:), 'pzmodel');
0031 
0032   cmd = '';
0033   for kk = 1:numel(objs)
0034 
0035     if ~isempty(objs(kk).hist)
0036       cmd = [cmd, sprintf('pzmodel(%s), ', string(objs(kk).hist.plistUsed))];
0037     else
0038       pl = plist();
0039       fields = fieldnames(objs(kk));
0040       for ii = 1:length(fields)
0041         field = fields{ii};
0042         pl = append(pl, field, objs(kk).(field));
0043       end
0044 
0045       cmd = [cmd 'pzmodel(' string(pl) '), '];
0046     end
0047 
0048   end
0049 
0050   cmd = cmd(1:end-2);
0051 
0052   if numel(objs) > 1
0053     cmd = ['[' cmd ']'];
0054   end
0055 
0056   varargout{1} = cmd;
0057 
0058 end
0059 
0060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0061 %                               Local Functions                               %
0062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0063 
0064 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0065 %
0066 % FUNCTION:    getInfo
0067 %
0068 % DESCRIPTION: Get Info Object
0069 %
0070 % HISTORY:     11-07-07 M Hewitson
0071 %                Creation.
0072 %
0073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0074 
0075 function ii = getInfo(varargin)
0076   if nargin == 1 && strcmpi(varargin{1}, 'None')
0077     sets = {};
0078     pl   = [];
0079   else
0080     sets = {'Default'};
0081     pl   = getDefaultPlist;
0082   end
0083   % Build info object
0084   ii = minfo(mfilename, 'pzmodel', '', utils.const.categories.helper, '$Id: string.m,v 1.10 2008/09/04 15:29:31 ingo Exp $', sets, pl);
0085 end
0086 
0087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0088 %
0089 % FUNCTION:    getDefaultPlist
0090 %
0091 % DESCRIPTION: Get Default Plist
0092 %
0093 % HISTORY:     11-07-07 M Hewitson
0094 %                Creation.
0095 %
0096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0097 
0098 function plo = getDefaultPlist()
0099   plo = plist();
0100 end
0101

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003