Home > classes > @cdata > display.m

display

PURPOSE ^

DISPLAY implement terminal display for cdata object.

SYNOPSIS ^

function txt = display(cdatas, varargin)

DESCRIPTION ^

 DISPLAY implement terminal display for cdata object.

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

 DESCRIPTION: DISPLAY implement terminal display for cdata object.

 VERSION: $Id: display.m,v 1.6 2008/01/08 16:39:11 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(cdatas, varargin)
0002 % DISPLAY implement terminal display for cdata object.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: DISPLAY implement terminal display for cdata object.
0007 %
0008 % VERSION: $Id: display.m,v 1.6 2008/01/08 16:39:11 ingo Exp $
0009 %
0010 % HISTORY: 31-01-2007 M Hewitson
0011 %             Creation
0012 %
0013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0014 
0015 VERSION = '$Id: display.m,v 1.6 2008/01/08 16:39:11 ingo Exp $';
0016 
0017 % Check if this is a call for parameters
0018 if nargin == 2
0019   if isa(cdatas, 'cdata') && ischar(varargin{1})
0020     in = char(varargin{1});
0021     if strcmp(in, 'Params')
0022       txt = plist();
0023       return
0024     elseif strcmp(in, 'Version')
0025       txt = VERSION;
0026       return
0027     end
0028   end
0029 end
0030 
0031 txt = {};
0032 
0033 for i=1:numel(cdatas)
0034   c = cdatas(i);
0035   banner = sprintf('-------- cdata %02d ------------', i);
0036   txt{end+1} = banner;
0037 
0038   txt{end+1} = ' ';
0039 
0040   y     = get(c, 'y');
0041   xinfo = whos('y');
0042 
0043   txt{end+1} = sprintf('  name:  %s', get(c, 'name'));
0044   txt{end+1} = sprintf('  y:  [%dx%d], %s', xinfo.size(1), xinfo.size(2), xinfo.class);
0045   x = get(c, 'x');
0046   tstr = '';
0047   for j=1:length(x)
0048     if j < 10
0049       tstr = [tstr ' ' char(x{j})];
0050     else
0051       tstr = [deblank(tstr) '...'];
0052       break;
0053     end
0054   end
0055 
0056   txt{end+1} = ['  x: ' tstr];
0057 
0058   banner_end(1:length(banner)) = '-';
0059   txt{end+1} = banner_end;
0060 
0061   txt{end+1} = ' ';
0062   txt{end+1} = ' ';
0063 end
0064 
0065 if nargout == 0
0066   for ii=1:length(txt)
0067     disp(txt{ii});
0068   end
0069 end
0070 
0071 % END

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