0001 function txt = display(xydatas, 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.6 2008/01/08 16:39:12 ingo Exp $';
0022
0023
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