Mercurial > hg > ltpda
comparison m-toolbox/classes/@xydata/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 xydata objects. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: DISPLAY overloads display functionality for xydata objects. | |
5 % | |
6 % CALL: txt = display(xy) | |
7 % | |
8 % INPUT: xy - xydata object | |
9 % | |
10 % OUTPUT: txt - cell array with strings to display the xydata object | |
11 % | |
12 % VERSION: $Id: display.m,v 1.16 2011/02/18 16:48:56 ingo Exp $ | |
13 % | |
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
15 | |
16 function varargout = display(varargin) | |
17 | |
18 xydatas = [varargin{:}]; | |
19 | |
20 txt = {}; | |
21 | |
22 for i=1:numel(xydatas) | |
23 xy = xydatas(i); | |
24 banner = sprintf('-------- xydata %02d ------------', i); | |
25 txt{end+1} = banner; | |
26 | |
27 txt{end+1} = ' '; | |
28 | |
29 txt{end+1} = sprintf(' x: [%d %d], %s', size(xy(i).x), class(xy(i).x)); | |
30 txt{end+1} = sprintf(' y: [%d %d], %s', size(xy(i).y), class(xy(i).y)); | |
31 txt{end+1} = sprintf(' dx: [%d %d], %s', size(xy(i).dx), class(xy(i).dx)); | |
32 txt{end+1} = sprintf(' dy: [%d %d], %s', size(xy(i).dy), class(xy(i).dy)); | |
33 txt{end+1} = sprintf('xunits: %s', char(xy.xunits)); | |
34 txt{end+1} = sprintf('yunits: %s', char(xy.yunits)); | |
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 end | |
50 | |
51 |