comparison m-toolbox/classes/@ssm/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 ssm object into a string.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: CHAR convert a ssm object into a string.
5 %
6 % CALL: string = char(ssm)
7 %
8 % <a href="matlab:utils.helper.displayMethodInfo('ssm', 'char')">Parameters Description</a>
9 %
10 % VERSION: $Id: char.m,v 1.13 2011/04/08 08:56:23 hewitson Exp $
11 %
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13
14 % TODO : make it work with symbolic (wait for symb. toolbox in R2008b'?)
15
16 function varargout = char(varargin)
17
18 %%% Check if this is a call for parameters
19 if utils.helper.isinfocall(varargin{:})
20 varargout{1} = getInfo(varargin{3});
21 return
22 end
23
24 objs = utils.helper.collect_objects(varargin(:), 'ssm');
25
26 pstr = '';
27
28 for ii = 1:numel(objs)
29 obj = objs(ii);
30 pstr = [pstr sprintf('ssm(name=%s), ', obj.name)];
31 end
32
33 pstr = pstr(1:end-2);
34
35 varargout{1} = pstr;
36 end
37
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 % Local Functions %
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41
42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43 %
44 % FUNCTION: getInfo
45 %
46 % DESCRIPTION: Get Info Object
47 %
48 % HISTORY: 110707 M Hewitson
49 % Creation.
50 %
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52
53 function ii = getInfo(varargin)
54 if nargin == 1 && strcmpi(varargin{1}, 'None')
55 sets = {};
56 pl = [];
57 else
58 sets = {'Default'};
59 pl = getDefaultPlist;
60 end
61 % Build info object
62 ii = minfo(mfilename, 'ssm', 'ltpda', utils.const.categories.output, '$Id: char.m,v 1.13 2011/04/08 08:56:23 hewitson Exp $', sets, pl);
63 end
64
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 %
67 % FUNCTION: getDefaultPlist
68 %
69 % DESCRIPTION: Get Default Plist
70 %
71 % HISTORY: 110707 M Hewitson
72 % Creation.
73 %
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75
76 function plo = getDefaultPlist()
77 plo = plist();
78 end
79
80