comparison m-toolbox/classes/@miir/setB.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 % SETB Set the property 'b'
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: SETB Set the property 'b'
5 %
6 % CALL: obj = obj.setB(12);
7 % obj = setB(obj, 12);
8 %
9 % INPUTS: obj - is a miir object
10 %
11 % <a href="matlab:utils.helper.displayMethodInfo('miir', 'setB')">Parameters Description</a>
12 %
13 % VERSION: $Id: setB.m,v 1.9 2011/04/08 08:56:33 hewitson Exp $
14 %
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 function varargout = setB(varargin)
18
19 % Check if this is a call from a class method
20 callerIsMethod = utils.helper.callerIsMethod;
21
22 %%% Check if this is a call for parameters
23 if utils.helper.isinfocall(varargin{:})
24 varargout{1} = getInfo(varargin{3});
25 return
26 end
27
28 obj = varargin{1};
29 val = varargin{2};
30
31 %%% Check inputs
32 if numel(obj) > 1
33 error('### This method supports only one input filter');
34 end
35
36 %%% If val is a plist-object then get the value out of the plist
37 if isa(val, 'plist')
38 val = find(val, 'b');
39 end
40
41 %%% decide whether we modify the miir-object, or create a new one.
42 obj = copy(obj, nargout);
43
44 %%% set 'b'
45 obj.b = val;
46
47 if ~callerIsMethod
48 obj.addHistory(getInfo('None'), plist('b', val), '', obj.hist);
49 end
50
51 varargout{1} = obj;
52 end
53
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 % Local Functions %
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 %
60 % FUNCTION: getInfo
61 %
62 % DESCRIPTION: Get Info Object
63 %
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65
66 function ii = getInfo(varargin)
67 if nargin == 1 && strcmpi(varargin{1}, 'None')
68 sets = {};
69 pl = [];
70 else
71 sets = {'Default'};
72 pl = getDefaultPlist;
73 end
74 % Build info object
75 ii = minfo(mfilename, mfilename('class'), 'ltpda', utils.const.categories.helper, '$Id: setB.m,v 1.9 2011/04/08 08:56:33 hewitson Exp $', sets, pl);
76 end
77
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79 %
80 % FUNCTION: getDefaultPlist
81 %
82 % DESCRIPTION: Get Default Plist
83 %
84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85
86 function plout = getDefaultPlist()
87 persistent pl;
88 if exist('pl', 'var')==0 || isempty(pl)
89 pl = buildplist();
90 end
91 plout = pl;
92 end
93
94 function pl = buildplist()
95 pl = plist({'b', 'A set of denominator coefficients.'}, paramValue.EMPTY_DOUBLE);
96 end
97