0001 function txt = display(tsdatas, varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 VERSION = '$Id: display.m,v 1.9 2008/01/08 16:39:12 ingo Exp $';
0022
0023
0024 if nargin == 2
0025 if isa(tsdatas, 'tsdata') && ischar(varargin{1})
0026 in = char(varargin{1});
0027 if strcmp(in, 'Params')
0028 txt = plist();
0029 return
0030 elseif strcmp(in, 'Version')
0031 txt = VERSION;
0032 return
0033 end
0034 end
0035 end
0036
0037 txt = {};
0038
0039 for i=1:numel(tsdatas)
0040 ts = tsdatas(i);
0041 banner = sprintf('-------- tsdata %02d ------------', i);
0042 txt{end+1} = banner;
0043
0044 txt{end+1} = ' ';
0045
0046 xdata = get(ts, 'x');
0047 ydata = get(ts, 'y');
0048 xinfo = whos('xdata');
0049 yinfo = whos('ydata');
0050
0051 txt{end+1} = sprintf(' name: %s', get(ts, 'name'));
0052 txt{end+1} = sprintf(' fs: %g', get(ts, 'fs'));
0053 txt{end+1} = sprintf(' x: [%d %d], %s', xinfo.size(1), xinfo.size(2), xinfo.class);
0054 txt{end+1} = sprintf(' y: [%d %d], %s', yinfo.size(1), yinfo.size(2), yinfo.class);
0055 txt{end+1} = sprintf('xunits: %s', get(ts, 'xunits'));
0056 txt{end+1} = sprintf('yunits: %s', get(ts, 'yunits'));
0057 txt{end+1} = sprintf(' nsecs: %d', get(ts, 'nsecs'));
0058 txt{end+1} = sprintf(' t0: %s', char(get(ts, 't0')));
0059
0060 banner_end(1:length(banner)) = '-';
0061 txt{end+1} = banner_end;
0062
0063 txt{end+1} = ' ';
0064 txt{end+1} = ' ';
0065 end
0066
0067 if nargout == 0
0068 for ii=1:length(txt)
0069 disp(txt{ii});
0070 end
0071 end
0072
0073