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