CHAR convert a time object into a string. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: CHAR convert a time object into a string. CALL: string = char(time) M-FILE INFO: Get information about this methods by calling >> time.getInfo('char') Get information about a specified set-plist by calling: >> time.getInfo('char', 'set') VERSION: $Id: char.m,v 1.12 2008/09/04 15:29:31 ingo Exp $ HISTORY: 23-07-2007 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % CHAR convert a time object into a string. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: CHAR convert a time object into a string. 0005 % 0006 % CALL: string = char(time) 0007 % 0008 % M-FILE INFO: Get information about this methods by calling 0009 % >> time.getInfo('char') 0010 % 0011 % Get information about a specified set-plist by calling: 0012 % >> time.getInfo('char', 'set') 0013 % 0014 % VERSION: $Id: char.m,v 1.12 2008/09/04 15:29:31 ingo Exp $ 0015 % 0016 % HISTORY: 23-07-2007 Diepholz 0017 % Creation 0018 % 0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0020 0021 function varargout = char(varargin) 0022 0023 %%% Check if this is a call for parameters 0024 if utils.helper.isinfocall(varargin{:}) 0025 varargout{1} = getInfo(varargin{3}); 0026 return 0027 end 0028 0029 % Collect all time-objects 0030 objs = utils.helper.collect_objects(varargin(:), 'time'); 0031 0032 % go through time-object 0033 pstr = ''; 0034 for jj=1:numel(objs) 0035 pstr = [pstr time.epoch2str(objs(jj)) ', ']; 0036 end 0037 0038 varargout{1} = pstr(1:end-2); 0039 end 0040 0041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0042 % Local Functions % 0043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0044 0045 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0046 % 0047 % FUNCTION: getInfo 0048 % 0049 % DESCRIPTION: Get Info Object 0050 % 0051 % HISTORY: 11-07-07 M Hewitson 0052 % Creation. 0053 % 0054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0055 0056 function ii = getInfo(varargin) 0057 if nargin == 1 && strcmpi(varargin{1}, 'None') 0058 sets = {}; 0059 pl = []; 0060 else 0061 sets = {'Default'}; 0062 pl = getDefaultPlist; 0063 end 0064 % Build info object 0065 ii = minfo(mfilename, 'time', '', utils.const.categories.output, '$Id: char.m,v 1.12 2008/09/04 15:29:31 ingo Exp $', sets, pl); 0066 end 0067 0068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0069 % 0070 % FUNCTION: getDefaultPlist 0071 % 0072 % DESCRIPTION: Get Default Plist 0073 % 0074 % HISTORY: 11-07-07 M Hewitson 0075 % Creation. 0076 % 0077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0078 0079 function plo = getDefaultPlist() 0080 plo = plist(); 0081 end 0082