Home > classes > @tsdata > display.m

display

PURPOSE ^

DISPLAY overloads display functionality for tsdata objects.

SYNOPSIS ^

function txt = display(tsdatas, varargin)

DESCRIPTION ^

 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

 VERSION:     $Id: display.m,v 1.10 2008/02/13 11:39:35 mauro Exp $

 HISTORY:     31-01-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function txt = display(tsdatas, varargin)
0002 % DISPLAY overloads display functionality for tsdata objects.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: DISPLAY overloads display functionality for tsdata objects.
0007 %
0008 % CALL:        txt    = display(tsdata)
0009 %
0010 % INPUT:       tsdata - tsdta object
0011 %
0012 % OUTPUT:      txt    - cell array with strings to display the tsdata object
0013 %
0014 % VERSION:     $Id: display.m,v 1.10 2008/02/13 11:39:35 mauro Exp $
0015 %
0016 % HISTORY:     31-01-2007 M Hewitson
0017 %                 Creation
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 
0021 VERSION = '$Id: display.m,v 1.10 2008/02/13 11:39:35 mauro Exp $';
0022 CATEGORY = 'Output';
0023 
0024 % Check if this is a call for parameters
0025 if nargin == 2
0026   if isa(tsdatas, 'tsdata') && ischar(varargin{1})
0027     in = char(varargin{1});
0028     if strcmp(in, 'Params')
0029       txt = plist();
0030       return
0031     elseif strcmp(in, 'Version')
0032       txt = VERSION;
0033       return
0034     elseif strcmp(in, 'Category')
0035       txt = CATEGORY;
0036       return
0037     end
0038   end
0039 end
0040 
0041 txt = {};
0042 
0043 for i=1:numel(tsdatas)
0044   ts = tsdatas(i);
0045   banner = sprintf('-------- tsdata %02d ------------', i);
0046   txt{end+1} = banner;
0047 
0048   txt{end+1} = ' ';
0049 
0050   xdata = get(ts, 'x');
0051   ydata = get(ts, 'y');
0052   xinfo = whos('xdata');
0053   yinfo = whos('ydata');
0054 
0055   txt{end+1} = sprintf('  name:  %s', get(ts, 'name'));
0056   txt{end+1} = sprintf('    fs:  %g', get(ts, 'fs'));
0057   txt{end+1} = sprintf('     x:  [%d %d], %s', xinfo.size(1), xinfo.size(2), xinfo.class);
0058   txt{end+1} = sprintf('     y:  [%d %d], %s', yinfo.size(1), yinfo.size(2), yinfo.class);
0059   txt{end+1} = sprintf('xunits:  %s', get(ts, 'xunits'));
0060   txt{end+1} = sprintf('yunits:  %s', get(ts, 'yunits'));
0061   txt{end+1} = sprintf(' nsecs:  %d', get(ts, 'nsecs'));
0062   txt{end+1} = sprintf('    t0:  %s', char(get(ts, 't0')));
0063 
0064   banner_end(1:length(banner)) = '-';
0065   txt{end+1} = banner_end;
0066 
0067   txt{end+1} = ' ';
0068   txt{end+1} = ' ';
0069 end
0070 
0071 if nargout == 0
0072   for ii=1:length(txt)
0073     disp(txt{ii});
0074   end
0075 end
0076 
0077 % END

Generated on Mon 31-Mar-2008 13:54:54 by m2html © 2003