Mercurial > hg > ltpda
comparison m-toolbox/classes/@ssm/getParams.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 % GETPARAMS returns the parameter list for this SSM model. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: GETPARAMS returns the parameter list for this SSM model. | |
5 % | |
6 % CALL: pl = obj.getParams; | |
7 % | |
8 % <a href="matlab:utils.helper.displayMethodInfo('ssm', 'getParams')">Parameters Description</a> | |
9 % | |
10 % VERSION: $Id: getParams.m,v 1.7 2011/04/08 08:56:24 hewitson Exp $ | |
11 % | |
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
13 | |
14 function varargout = getParams(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 import utils.const.* | |
23 utils.helper.msg(msg.PROC3, 'running %s/%s', mfilename('class'), mfilename); | |
24 | |
25 ssms = utils.helper.collect_objects(varargin(:), 'ssm'); | |
26 | |
27 pls = plist.initObjectWithSize(size(ssms,1), size(ssms,2)); | |
28 | |
29 %% Loop over the input ssm objects | |
30 for kk = 1:numel(ssms) | |
31 ss = ssms(kk); | |
32 pls(kk) = ss.params; | |
33 end % End loop over ssm objects | |
34 | |
35 %% Set output depending on nargout | |
36 if nargout == numel(pls) | |
37 for i=1:nargout | |
38 varargout{i} = pls(i); | |
39 end | |
40 else | |
41 varargout{1} = pls; | |
42 end | |
43 end | |
44 | |
45 %-------------------------------------------------------------------------- | |
46 % Get Info Object | |
47 %-------------------------------------------------------------------------- | |
48 function ii = getInfo(varargin) | |
49 | |
50 if nargin == 1 && strcmpi(varargin{1}, 'None') | |
51 sets = {}; | |
52 pl = []; | |
53 else | |
54 sets = {'Default'}; | |
55 pl = getDefaultPlist; | |
56 end | |
57 % Build info object | |
58 ii = minfo(mfilename, 'ssm', 'ltpda', utils.const.categories.output, '$Id: getParams.m,v 1.7 2011/04/08 08:56:24 hewitson Exp $', sets, pl); | |
59 end | |
60 | |
61 function plo = getDefaultPlist() | |
62 plo = plist(); | |
63 | |
64 % parameters | |
65 p = param({'parameters', 'The plist containing the list of parameters you want the values of.'}, {1, {plist}, paramValue.OPTIONAL}); | |
66 plo.append(p); | |
67 end | |
68 | |
69 |