Home > classes > @xydata > display.m

display

PURPOSE ^

DISPLAY overloads display functionality for xydata objects.

SYNOPSIS ^

function txt = display(xydatas, varargin)

DESCRIPTION ^

 DISPLAY overloads display functionality for xydata objects.

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

 DESCRIPTION: DISPLAY overloads display functionality for xydata objects.

 CALL:        txt    = display(xydata)

 INPUT:       xydata - tsdta object

 OUTPUT:      txt    - cell array with strings to display the xydata object

 VERSION:     $Id: display.m,v 1.6 2008/01/08 16:39:12 ingo 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(xydatas, varargin)
0002 % DISPLAY overloads display functionality for xydata objects.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: DISPLAY overloads display functionality for xydata objects.
0007 %
0008 % CALL:        txt    = display(xydata)
0009 %
0010 % INPUT:       xydata - tsdta object
0011 %
0012 % OUTPUT:      txt    - cell array with strings to display the xydata object
0013 %
0014 % VERSION:     $Id: display.m,v 1.6 2008/01/08 16:39:12 ingo Exp $
0015 %
0016 % HISTORY:     31-01-2007 M Hewitson
0017 %                 Creation
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 
0021 VERSION = '$Id: display.m,v 1.6 2008/01/08 16:39:12 ingo Exp $';
0022 
0023 % Check if this is a call for parameters
0024 if nargin == 2
0025   if isa(xydatas, 'xydata') && 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(xydatas)
0040   xy = xydatas(i);
0041   banner = sprintf('-------- xydata %02d ------------', i);
0042   txt{end+1} = banner;
0043 
0044   txt{end+1} = ' ';
0045 
0046   xdata = get(xy, 'x');
0047   ydata = get(xy, 'y');
0048   xinfo = whos('xdata');
0049   yinfo = whos('ydata');
0050 
0051   txt{end+1} = sprintf('  name:  %s', get(xy, 'name'));
0052   txt{end+1} = sprintf('     x:  [%d %d], %s', xinfo.size(1), xinfo.size(2), xinfo.class);
0053   txt{end+1} = sprintf('     y:  [%d %d], %s', yinfo.size(1), yinfo.size(2), yinfo.class);
0054   txt{end+1} = sprintf('xunits:  %s', get(xy, 'xunits'));
0055   txt{end+1} = sprintf('yunits:  %s', get(xy, 'yunits'));
0056 
0057   banner_end(1:length(banner)) = '-';
0058   txt{end+1} = banner_end;
0059 
0060   txt{end+1} = ' ';
0061   txt{end+1} = ' ';
0062 end
0063 
0064 if nargout == 0
0065   for ii=1:length(txt)
0066     disp(txt{ii});
0067   end
0068 end
0069 
0070 % END

Generated on Tue 22-Jan-2008 10:39:13 by m2html © 2003