Home > classes > @cdata > display.m

display

PURPOSE ^

DISPLAY implement terminal display for cdata object.

SYNOPSIS ^

function txt = display(cdatas)

DESCRIPTION ^

 DISPLAY implement terminal display for cdata object.

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

 DESCRIPTION: DISPLAY implement terminal display for cdata object.

 VERSION: $Id: display.m,v 1.3 2007/06/19 08:00:05 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)
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.3 2007/06/19 08:00:05 ingo Exp $
0009 %
0010 % HISTORY: 31-01-2007 M Hewitson
0011 %             Creation
0012 %
0013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0014 
0015 txt = {};
0016 
0017 cdatas  = reshape(cdatas, numel(cdatas), 1);
0018 
0019 for i=1:length(cdatas)
0020   c = cdatas(i);
0021   banner = sprintf('-------- cdata %02d ------------', i);
0022   txt{end+1} = banner;
0023 
0024   txt{end+1} = ' ';
0025 
0026   vals  = get(c, 'vals');
0027   xinfo = whos('vals');
0028 
0029   txt{end+1} = sprintf('  name:  %s', get(c, 'name'));
0030   txt{end+1} = sprintf('  vals:  [%d %d], %s', xinfo.size(1), xinfo.size(2), xinfo.class);
0031   tags = get(c, 'tags');
0032   tstr = '';
0033   for j=1:length(tags)
0034     if j < 10
0035       tstr = [tstr ' ' char(tags{j})];
0036     else
0037       tstr = [deblank(tstr) '...'];
0038       break;
0039     end
0040   end
0041 
0042   txt{end+1} = ['  tags: ' tstr];
0043 
0044   banner_end(1:length(banner)) = '-';
0045   txt{end+1} = banner_end;
0046 
0047   txt{end+1} = ' ';
0048   txt{end+1} = ' ';
0049 end
0050 
0051 if nargout == 0
0052   for ii=1:length(txt)
0053     disp(txt{ii});
0054   end
0055 end
0056 
0057 % END

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003