comparison m-toolbox/classes/@tsdata/display.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % DISPLAY overloads display functionality for tsdata objects.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: DISPLAY overloads display functionality for tsdata objects.
5 %
6 % CALL: txt = display(tsdata)
7 %
8 % INPUT: tsdata - tsdta object
9 %
10 % OUTPUT: txt - cell array with strings to display the tsdata object
11 %
12 % VERSION: $Id: display.m,v 1.28 2011/07/05 06:35:10 mauro Exp $
13 %
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15
16 function varargout = display(varargin)
17
18 tsdatas = [varargin{:}];
19
20 txt = {};
21
22 for i=1:numel(tsdatas)
23 ts = tsdatas(i);
24 banner = sprintf('-------- tsdata %02d ------------', i);
25 txt{end+1} = banner;
26
27 txt{end+1} = ' ';
28
29 xdata = ts.x;
30 ydata = ts.y;
31 dxdata = ts.dx;
32 dydata = ts.dy;
33 yinfo = size(ydata);
34 if ~isempty(xdata)
35 xinfo = size(xdata);
36 else
37 xinfo = yinfo;
38 end
39 dxinfo = size(ts.dx);
40 dyinfo = size(ts.dy);
41
42 txt{end+1} = sprintf(' fs: %0.9g', ts.fs);
43 txt{end+1} = sprintf(' x: [%d %d], %s', xinfo, class(xdata));
44 txt{end+1} = sprintf(' y: [%d %d], %s', yinfo, class(ydata));
45 txt{end+1} = sprintf(' dx: [%d %d], %s', dxinfo, class(xdata));
46 txt{end+1} = sprintf(' dy: [%d %d], %s', dyinfo, class(ydata));
47 txt{end+1} = sprintf(' xunits: %s', char(ts.xunits));
48 txt{end+1} = sprintf(' yunits: %s', char(ts.yunits));
49 txt{end+1} = sprintf(' nsecs: %g', ts.nsecs);
50 txt{end+1} = sprintf(' t0: %s', char(ts.t0));
51
52 banner_end(1:length(banner)) = '-';
53 txt{end+1} = banner_end;
54
55 txt{end+1} = ' ';
56 end
57
58 if nargout == 0
59 for ii=1:length(txt)
60 disp(txt{ii});
61 end
62 elseif nargout == 1
63 varargout{1} = txt;
64 end
65
66 end
67