STRING writes a command string that can be used to recreate the input statespace model object. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: STRING writes a command string that can be used to recreate the input statespace model object. CALL: cmd = string(ssm) INPUTS: cmd - statespace model object OUTPUTS: ssm - command string to create the statespace model object M-FILE INFO: Get information about this methods by calling >> ssm.getInfo('string') Get information about a specified set-plist by calling: >> ssm.getInfo('string', 'None') VERSION: $Id: string.m,v 1.8 2008/07/21 13:57:30 ingo Exp $ HISTORY: 29-03-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % STRING writes a command string that can be used to recreate the input statespace model object. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: STRING writes a command string that can be used to recreate the 0005 % input statespace model object. 0006 % 0007 % CALL: cmd = string(ssm) 0008 % 0009 % INPUTS: cmd - statespace model object 0010 % 0011 % OUTPUTS: ssm - command string to create the statespace model object 0012 % 0013 % M-FILE INFO: Get information about this methods by calling 0014 % >> ssm.getInfo('string') 0015 % 0016 % Get information about a specified set-plist by calling: 0017 % >> ssm.getInfo('string', 'None') 0018 % 0019 % VERSION: $Id: string.m,v 1.8 2008/07/21 13:57:30 ingo Exp $ 0020 % 0021 % HISTORY: 29-03-2007 M Hewitson 0022 % Creation 0023 % 0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0025 0026 function varargout = string(varargin) 0027 utils.helper.msg(utils.const.msg.MNAME, ['running ', mfilename]); 0028 0029 %%% Check if this is a call for parameters 0030 if utils.helper.isinfocall(varargin{:}) 0031 varargout{1} = getInfo(varargin{3}); 0032 return 0033 end 0034 0035 %%% Get minfo objects 0036 objs = utils.helper.collect_objects(varargin(:), 'ssm'); 0037 0038 cmd = ''; 0039 for kk = 1:numel(objs) 0040 pl = objs(kk).hist.plistUsed; 0041 cmd = [cmd 'ssm(' string(pl) '), ']; 0042 end 0043 0044 cmd = cmd(1:end-2); 0045 0046 if numel(objs) > 1 0047 cmd = ['[' cmd ']']; 0048 end 0049 0050 varargout{1} = cmd; 0051 end 0052 0053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0054 % Local Functions % 0055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0056 0057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0058 % 0059 % FUNCTION: getInfo 0060 % 0061 % DESCRIPTION: Get Info Object 0062 % 0063 % HISTORY: 11-07-07 M Hewitson 0064 % Creation. 0065 % 0066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0067 0068 function ii = getInfo(varargin) 0069 if nargin == 1 && strcmpi(varargin{1}, 'None') 0070 sets = {}; 0071 pl = []; 0072 else 0073 sets = {'Default'}; 0074 pl = getDefaultPlist; 0075 end 0076 % Build info object 0077 ii = minfo(mfilename, 'ssm', '', 'Output', '$Id: string.m,v 1.8 2008/07/21 13:57:30 ingo Exp $', sets, pl); 0078 end 0079 0080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0081 % 0082 % FUNCTION: getDefaultPlist 0083 % 0084 % DESCRIPTION: Get Default Plist 0085 % 0086 % HISTORY: 11-07-07 M Hewitson 0087 % Creation. 0088 % 0089 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0090 0091 function plo = getDefaultPlist() 0092 plo = plist(); 0093 end 0094