Home > classes > @tsdata > display.m

display

PURPOSE ^

DISPLAY overloads display functionality for tsdata objects.

SYNOPSIS ^

function varargout = display(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

 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.16 2008/08/15 11:45:19 ingo Exp $

 HISTORY:     31-01-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

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.16 2008/08/15 11:45:19 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.getX;
0045     ydata = ts.y;
0046     xinfo = size(xdata);
0047     yinfo = size(ydata);
0048 
0049     txt{end+1} = sprintf('    fs:  %g', ts.fs);
0050     txt{end+1} = sprintf('     x:  [%d %d], %s', xinfo(1), xinfo(2), class(xdata));
0051     txt{end+1} = sprintf('     y:  [%d %d], %s', yinfo(1), yinfo(2), class(ydata));
0052     txt{end+1} = sprintf('xunits:  %s', char(ts.xunits));
0053     txt{end+1} = sprintf('yunits:  %s', char(ts.yunits));
0054     txt{end+1} = sprintf(' nsecs:  %g', ts.nsecs);
0055     txt{end+1} = sprintf('    t0:  %s', char(ts.t0));
0056 
0057     banner_end(1:length(banner)) = '-';
0058     txt{end+1} = banner_end;
0059 
0060     txt{end+1} = ' ';
0061   end
0062 
0063   if nargout == 0
0064     for ii=1:length(txt)
0065       disp(txt{ii});
0066     end
0067   elseif nargout == 1
0068     varargout{1} = txt;
0069   end
0070 
0071 end
0072 
0073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0074 %                               Local Functions                               %
0075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0076 
0077 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0078 %
0079 % FUNCTION:    getInfo
0080 %
0081 % DESCRIPTION: Get Info Object
0082 %
0083 % HISTORY:     11-07-07 M Hewitson
0084 %                Creation.
0085 %
0086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0087 
0088 function ii = getInfo(varargin)
0089   if nargin == 1 && strcmpi(varargin{1}, 'None')
0090     sets = {};
0091     pl   = [];
0092   else
0093     sets = {'Default'};
0094     pl   = getDefaultPlist;
0095   end
0096   % Build info object
0097   ii = minfo(mfilename, 'tsdata', '', 'Output', '$Id: display.m,v 1.16 2008/08/15 11:45:19 ingo Exp $', sets, pl);
0098 end
0099 
0100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0101 %
0102 % FUNCTION:    getDefaultPlist
0103 %
0104 % DESCRIPTION: Get Default Plist
0105 %
0106 % HISTORY:     11-07-07 M Hewitson
0107 %                Creation.
0108 %
0109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0110 
0111 function plo = getDefaultPlist()
0112   plo = plist();
0113 end
0114

Generated on Mon 25-Aug-2008 22:39:29 by m2html © 2003