comparison m-toolbox/classes/@xyzdata/display.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % DISPLAY overloads display functionality for xyzdata objects.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: DISPLAY overloads display functionality for xyzdata objects.
5 %
6 % CALL: txt = display(xyzdata)
7 %
8 % INPUT: xyzdata - an xyz data object
9 %
10 % OUTPUT: txt - cell array with strings to display the xyzdata object
11 %
12 % VERSION: $Id: display.m,v 1.11 2011/02/18 16:48:56 ingo Exp $
13 %
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15
16 function varargout = display(varargin)
17
18 xyzdatas = utils.helper.collect_objects(varargin(:), 'xyzdata');
19
20 txt = {};
21
22 for i=1:numel(xyzdatas)
23 xyz = xyzdatas(i);
24 banner = sprintf('-------- xyzdata %02d ------------', i);
25 txt{end+1} = banner;
26
27 txt{end+1} = ' ';
28
29 txt{end+1} = sprintf(' x: [%d %d], %s', size(xyz.x), class(xyz.x));
30 txt{end+1} = sprintf(' y: [%d %d], %s', size(xyz.y), class(xyz.y));
31 txt{end+1} = sprintf(' z: [%d %d], %s', size(xyz.z), class(xyz.z));
32 txt{end+1} = sprintf('xunits: %s', char(xyz.xunits));
33 txt{end+1} = sprintf('yunits: %s', char(xyz.yunits));
34 txt{end+1} = sprintf('zunits: %s', char(xyz.zunits));
35
36 banner_end(1:length(banner)) = '-';
37 txt{end+1} = banner_end;
38
39 txt{end+1} = ' ';
40 end
41
42 if nargout == 0
43 for ii=1:length(txt)
44 disp(txt{ii});
45 end
46 elseif nargout == 1
47 varargout{1} = txt;
48 end
49
50 end
51