CHAR convert a ltpda_data-object into a string. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: CHAR convert a ltpda_data object into a string. CALL: string = char(fsdata) M-FILE INFO: Get information about this methods by calling >> fsdata.getInfo('char') Get information about a specified set-plist by calling: >> fsdata.getInfo('char', 'set') VERSION: $Id: char.m,v 1.4 2008/09/04 15:29:30 ingo Exp $ HISTORY: 23-07-2007 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % CHAR convert a ltpda_data-object into a string. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: CHAR convert a ltpda_data object into a string. 0005 % 0006 % CALL: string = char(fsdata) 0007 % 0008 % M-FILE INFO: Get information about this methods by calling 0009 % >> fsdata.getInfo('char') 0010 % 0011 % Get information about a specified set-plist by calling: 0012 % >> fsdata.getInfo('char', 'set') 0013 % 0014 % VERSION: $Id: char.m,v 1.4 2008/09/04 15:29:30 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 ltpda_data-objects 0030 objs = utils.helper.collect_objects(varargin(:), 'data2D'); 0031 0032 %%% Add the size of the data (all) 0033 pstr = sprintf('Ndata=[%sx%s],', num2str(size(objs.y,1)), num2str(size(objs.y,2))); 0034 0035 %%% Add the sample rate of data (tsdata, fsdata) 0036 if isprop(objs, 'fs') 0037 pstr = sprintf('%s fs=%g,', pstr, objs.fs); 0038 end 0039 0040 %%% Add the length of this time-series in seconds (tsdata) 0041 if isprop(objs, 'nsecs') 0042 pstr = sprintf('%s nsecs=%d,', pstr, objs.nsecs); 0043 end 0044 0045 %%% Add number of averages (fsdata) 0046 if isprop(objs, 'navs') 0047 pstr = sprintf('%s navs=%d,', pstr, objs.navs); 0048 end 0049 0050 %%% Add time-stamp of the first data sample (fsdata, tsdata) 0051 if isprop(objs, 't0') 0052 pstr = sprintf('%s t0=%s,', pstr, char(objs.t0)); 0053 end 0054 0055 pstr = pstr(1:end-1); 0056 0057 varargout{1} = pstr; 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, 'data2D', '', utils.const.categories.output, '$Id: char.m,v 1.4 2008/09/04 15:29:30 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