comparison m-toolbox/classes/@plotter/char.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 % CHAR convert a plotter object into a string.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: CHAR convert a plotter object into a string.
5 %
6 % CALL: string = char(obj)
7 %
8 % VERSION: $Id: char.m,v 1.2 2010/12/12 08:29:00 hewitson Exp $
9 %
10 % HISTORY: 04-06-2008 M Hewitson
11 % Creation
12 %
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
15 function varargout = char(varargin)
16
17 objs = utils.helper.collect_objects(varargin(:), 'plotter');
18
19 pstr = '';
20 for ii = 1:numel(objs)
21
22 pp = objs(ii);
23
24 % data class
25 N = numel(pp.data);
26 for kk=1:N
27 d = pp.data{kk};
28 pstr = [pstr sprintf('%s [%s]', d.name, class(d))];
29 if kk< N
30 pstr = [pstr ' / '];
31 end
32 end
33 end
34
35 %%% Prepare output
36 varargout{1} = pstr;
37 end
38