STRING writes a command string that can be used to recreate the input timeformat object. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: STRING writes a command string that can be used to recreate the input timeformat object. CALL: cmd = string(obj) INPUT: obj - timeformat object OUTPUT: cmd - command string to create the input object VERSION: $Id: string.m,v 1.1 2008/02/15 17:38:59 ingo Exp $ HISTORY: 15-02-2008 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function cmd = string(objs, varargin) 0002 % STRING writes a command string that can be used to recreate the input timeformat object. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: STRING writes a command string that can be used to recreate the 0007 % input timeformat object. 0008 % 0009 % CALL: cmd = string(obj) 0010 % 0011 % INPUT: obj - timeformat object 0012 % 0013 % OUTPUT: cmd - command string to create the input object 0014 % 0015 % VERSION: $Id: string.m,v 1.1 2008/02/15 17:38:59 ingo Exp $ 0016 % 0017 % HISTORY: 15-02-2008 Diepholz 0018 % Creation 0019 % 0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 0022 VERSION = '$Id: string.m,v 1.1 2008/02/15 17:38:59 ingo Exp $'; 0023 CATEGORY = 'Output'; 0024 0025 % Check if this is a call for parameters 0026 if nargin == 2 0027 if isa(objs, 'timeformat') && ischar(varargin{1}) 0028 in = char(varargin{1}); 0029 if strcmp(in, 'Params') 0030 cmd = plist; 0031 return 0032 elseif strcmp(in, 'Version') 0033 cmd = VERSION; 0034 return 0035 elseif strcmp(in, 'Category') 0036 cmd = CATEGORY; 0037 return 0038 end 0039 end 0040 end 0041 0042 %%% Wrap the command only in bracket if the there are more than one object 0043 if length(objs) > 1 0044 cmd = '['; 0045 else 0046 cmd = ''; 0047 end 0048 0049 for j=1:length(objs) 0050 obj = objs(j); 0051 0052 format_str = obj.format_str; 0053 default_matlab_str = obj.default_matlab_str; 0054 default_matlab_nr = obj.default_matlab_nr; 0055 default_java_str = obj.default_java_str; 0056 0057 cmd = [cmd 'timeformat(''' format_str ''', ''' default_matlab_str ''', ' num2str(default_matlab_nr) ', ''' default_java_str ''') ']; 0058 end 0059 0060 if length(objs) > 1 0061 cmd = [cmd ']']; 0062 end 0063 0064 % END