0001 function txt = display(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 VERSION = '$Id: display.m,v 1.2 2008/01/08 16:39:12 ingo Exp $';
0022
0023
0024 if nargin == 2
0025 if ischar(varargin{2})
0026 in = char(varargin{2});
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 xyzdatas = varargin{1};
0040
0041 for i=1:numel(xyzdatas)
0042 xyz = xyzdatas(i);
0043 banner = sprintf('-------- xyzdata %02d ------------', i);
0044 txt{end+1} = banner;
0045
0046 txt{end+1} = ' ';
0047
0048 xdata = get(xyz, 'x');
0049 ydata = get(xyz, 'y');
0050 zdata = get(xyz, 'z');
0051 xinfo = whos('xdata');
0052 yinfo = whos('ydata');
0053 zinfo = whos('zdata');
0054
0055 txt{end+1} = sprintf(' name: %s', get(xyz, 'name'));
0056 txt{end+1} = sprintf(' x: [%d %d], %s', xinfo.size(1), xinfo.size(2), xinfo.class);
0057 txt{end+1} = sprintf(' y: [%d %d], %s', yinfo.size(1), yinfo.size(2), yinfo.class);
0058 txt{end+1} = sprintf(' z: [%d %d], %s', zinfo.size(1), zinfo.size(2), zinfo.class);
0059 txt{end+1} = sprintf('xunits: %s', get(xyz, 'xunits'));
0060 txt{end+1} = sprintf('yunits: %s', get(xyz, 'yunits'));
0061 txt{end+1} = sprintf('zunits: %s', get(xyz, 'zunits'));
0062
0063 banner_end(1:length(banner)) = '-';
0064 txt{end+1} = banner_end;
0065
0066 txt{end+1} = ' ';
0067 txt{end+1} = ' ';
0068 end
0069
0070 if nargout == 0
0071 for ii=1:length(txt)
0072 disp(txt{ii});
0073 end
0074 end
0075
0076