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