0001 function txt = display(cdatas, varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 VERSION = '$Id: display.html,v 1.14 2008/03/31 10:27:37 hewitson Exp $';
0016 CATEGORY = 'Output';
0017
0018
0019 if nargin == 2
0020 if isa(cdatas, 'cdata') && ischar(varargin{1})
0021 in = char(varargin{1});
0022 if strcmp(in, 'Params')
0023 txt = plist();
0024 return
0025 elseif strcmp(in, 'Version')
0026 txt = VERSION;
0027 return
0028 elseif strcmp(in, 'Category')
0029 txt = CATEGORY;
0030 return
0031 end
0032 end
0033 end
0034
0035 txt = {};
0036
0037 for i=1:numel(cdatas)
0038 c = cdatas(i);
0039 banner = sprintf('-------- cdata %02d ------------', i);
0040 txt{end+1} = banner;
0041
0042 txt{end+1} = ' ';
0043
0044 y = get(c, 'y');
0045 xinfo = whos('y');
0046
0047 txt{end+1} = sprintf(' name: %s', get(c, 'name'));
0048 txt{end+1} = sprintf(' y: [%dx%d], %s', xinfo.size(1), xinfo.size(2), xinfo.class);
0049 x = get(c, 'x');
0050 tstr = '';
0051 for j=1:length(x)
0052 if j < 10
0053 tstr = [tstr ' ' char(x{j})];
0054 else
0055 tstr = [deblank(tstr) '...'];
0056 break;
0057 end
0058 end
0059
0060 txt{end+1} = [' x: ' tstr];
0061
0062 banner_end(1:length(banner)) = '-';
0063 txt{end+1} = banner_end;
0064
0065 txt{end+1} = ' ';
0066 txt{end+1} = ' ';
0067 end
0068
0069 if nargout == 0
0070 for ii=1:length(txt)
0071 disp(txt{ii});
0072 end
0073 end
0074
0075