comparison m-toolbox/classes/@smodel/fitfunc.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 % FITFUNC Returns a function handle which sets the 'values' and 'xvals' to a ltpda model.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: FITFUNC Returns a function handle which sets the 'values'
5 % and 'xvals' to a ltpda model.
6 %
7 % CALL: h = obj.fitfunc();
8 %
9 % INPUTS: obj - one ltpda model.
10 %
11 % <a href="matlab:utils.helper.displayMethodInfo('smodel', 'fitfunc')">Parameters Description</a>
12 %
13 % VERSION: $Id: fitfunc.m,v 1.7 2011/04/08 08:56:28 hewitson Exp $
14 %
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 function modelFunc = fitfunc(varargin)
18
19 %%% Check if this is a call for parameters
20 if utils.helper.isinfocall(varargin{:})
21 modelFunc = getInfo(varargin{3});
22 return
23 end
24
25 mdl = varargin{1};
26
27 modelFunc = @(x)double(mdl.setValues(x));
28
29 end
30
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32 % Local Functions %
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36 %
37 % FUNCTION: getInfo
38 %
39 % DESCRIPTION: Get Info Object
40 %
41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42
43 function ii = getInfo(varargin)
44 if nargin == 1 && strcmpi(varargin{1}, 'None')
45 sets = {};
46 pl = [];
47 else
48 sets = {'Default'};
49 pl = getDefaultPlist;
50 end
51 % Build info object
52 ii = minfo(mfilename, 'smodel', 'ltpda', utils.const.categories.helper, '$Id: fitfunc.m,v 1.7 2011/04/08 08:56:28 hewitson Exp $', sets, pl);
53 ii.setModifier(false);
54 end
55
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 %
58 % FUNCTION: getDefaultPlist
59 %
60 % DESCRIPTION: Get Default Plist
61 %
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63
64 function plout = getDefaultPlist()
65 persistent pl;
66 if exist('pl', 'var')==0 || isempty(pl)
67 pl = buildplist();
68 end
69 plout = pl;
70 end
71
72 function pl = buildplist()
73 pl = plist.EMPTY_PLIST;
74 end
75