Mercurial > hg > ltpda
comparison m-toolbox/m/helper/keys.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 function varargout = keys(varargin) | |
2 | |
3 className = varargin{1}; | |
4 if nargin > 1 | |
5 methodName = varargin{2} | |
6 else | |
7 methodName = className; | |
8 end | |
9 | |
10 cmd = sprintf('%s.getInfo(''%s'')', className, methodName); | |
11 ii = eval(cmd); | |
12 | |
13 out = ''; | |
14 for kk=1:numel(ii.sets) | |
15 set = ii.sets{kk}; | |
16 out = [out repmat('-', 1, length(set))]; | |
17 out = [out sprintf('\n')]; | |
18 out = [out sprintf('%s\n', set)]; | |
19 out = [out repmat('-', 1, length(set))]; | |
20 out = [out sprintf('\n')]; | |
21 | |
22 pl = ii.plists(kk); | |
23 keys = pl.getKeys(); | |
24 keyLine = ''; | |
25 for ll=1:numel(keys) | |
26 key = keys{ll}; | |
27 keyLine = [keyLine key]; | |
28 if length(keyLine)>100 | |
29 keyLine = [keyLine sprintf('\n')]; | |
30 out = [out keyLine]; | |
31 keyLine = ''; | |
32 else | |
33 if ll < numel(keys) | |
34 keyLine = [keyLine ', ']; | |
35 end | |
36 end | |
37 end | |
38 out = [out keyLine sprintf('\n\n')]; | |
39 | |
40 end | |
41 | |
42 disp(out); | |
43 | |
44 if nargout > 0 | |
45 varargout{1} = out; | |
46 end | |
47 | |
48 end |