DISPLAY overloads display functionality for tsdata objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: DISPLAY overloads display functionality for tsdata objects. CALL: txt = display(tsdata) INPUT: tsdata - tsdta object OUTPUT: txt - cell array with strings to display the tsdata object M-FILE INFO: Get information about this methods by calling >> tsdata.getInfo('display') Get information about a specified set-plist by calling: >> tsdata.getInfo('display', 'None') VERSION: $Id: display.m,v 1.18 2008/09/04 15:29:32 ingo Exp $ HISTORY: 31-01-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % DISPLAY overloads display functionality for tsdata objects. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: DISPLAY overloads display functionality for tsdata objects. 0005 % 0006 % CALL: txt = display(tsdata) 0007 % 0008 % INPUT: tsdata - tsdta object 0009 % 0010 % OUTPUT: txt - cell array with strings to display the tsdata object 0011 % 0012 % M-FILE INFO: Get information about this methods by calling 0013 % >> tsdata.getInfo('display') 0014 % 0015 % Get information about a specified set-plist by calling: 0016 % >> tsdata.getInfo('display', 'None') 0017 % 0018 % VERSION: $Id: display.m,v 1.18 2008/09/04 15:29:32 ingo Exp $ 0019 % 0020 % HISTORY: 31-01-2007 M Hewitson 0021 % Creation 0022 % 0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0024 0025 function varargout = display(varargin) 0026 0027 %%% Check if this is a call for parameters 0028 if utils.helper.isinfocall(varargin{:}) 0029 varargout{1} = getInfo(varargin{3}); 0030 return 0031 end 0032 0033 tsdatas = utils.helper.collect_objects(varargin(:), 'tsdata'); 0034 0035 txt = {}; 0036 0037 for i=1:numel(tsdatas) 0038 ts = tsdatas(i); 0039 banner = sprintf('-------- tsdata %02d ------------', i); 0040 txt{end+1} = banner; 0041 0042 txt{end+1} = ' '; 0043 0044 xdata = ts.x; 0045 ydata = ts.y; 0046 yinfo = size(ydata); 0047 if ~isempty(xdata) 0048 xinfo = size(xdata); 0049 else 0050 xinfo = yinfo; 0051 end 0052 0053 txt{end+1} = sprintf(' fs: %g', ts.fs); 0054 txt{end+1} = sprintf(' x: [%d %d], %s', xinfo(1), xinfo(2), class(xdata)); 0055 txt{end+1} = sprintf(' y: [%d %d], %s', yinfo(1), yinfo(2), class(ydata)); 0056 txt{end+1} = sprintf('xunits: %s', char(ts.xunits)); 0057 txt{end+1} = sprintf('yunits: %s', char(ts.yunits)); 0058 txt{end+1} = sprintf(' nsecs: %g', ts.nsecs); 0059 txt{end+1} = sprintf(' t0: %s', char(ts.t0)); 0060 0061 banner_end(1:length(banner)) = '-'; 0062 txt{end+1} = banner_end; 0063 0064 txt{end+1} = ' '; 0065 end 0066 0067 if nargout == 0 0068 for ii=1:length(txt) 0069 disp(txt{ii}); 0070 end 0071 elseif nargout == 1 0072 varargout{1} = txt; 0073 end 0074 0075 end 0076 0077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0078 % Local Functions % 0079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0080 0081 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0082 % 0083 % FUNCTION: getInfo 0084 % 0085 % DESCRIPTION: Get Info Object 0086 % 0087 % HISTORY: 11-07-07 M Hewitson 0088 % Creation. 0089 % 0090 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0091 0092 function ii = getInfo(varargin) 0093 if nargin == 1 && strcmpi(varargin{1}, 'None') 0094 sets = {}; 0095 pl = []; 0096 else 0097 sets = {'Default'}; 0098 pl = getDefaultPlist; 0099 end 0100 % Build info object 0101 ii = minfo(mfilename, 'tsdata', '', utils.const.categories.output, '$Id: display.m,v 1.18 2008/09/04 15:29:32 ingo Exp $', sets, pl); 0102 end 0103 0104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0105 % 0106 % FUNCTION: getDefaultPlist 0107 % 0108 % DESCRIPTION: Get Default Plist 0109 % 0110 % HISTORY: 11-07-07 M Hewitson 0111 % Creation. 0112 % 0113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0114 0115 function plo = getDefaultPlist() 0116 plo = plist(); 0117 end 0118