view m-toolbox/classes/+utils/@models/getDefaultPlist.m @ 37:a4b7ceae0403
database-connection-manager
Show backtrace on unit test errors
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Mon, 05 Dec 2011 16:20:06 +0100 (2011-12-05)
parents
f0afece42f48
children
line source
+ − % GETDEFAULTPLIST returns a default plist for the model
+ − %
+ − % CALL: utils.models.functionForVersion(@getModelDescription, @versionTable)
+ − % CALL: utils.models.functionForVersion(@getModelDescription, @versionTable, version, @getFileVersion)
+ − %
+ − function pl = getDefaultPlist(varargin)
+ −
+ − getModelDescription = varargin{1};
+ − versionTable = varargin{2};
+ − options = {};
+ − if nargin > 2
+ − if ischar(varargin{3})
+ − options = varargin(3);
+ − else
+ − options = varargin{3};
+ − end
+ − end
+ −
+ − % default plist for all model versions
+ − vt = versionTable();
+ − idx = 1; % we take the first version as default
+ − versions = vt(1:2:end);
+ − if numel(options)>=1 && ischar(options{1})
+ − idx = find(strcmp(options{1}, versions));
+ − if ~utils.helper.ismember(options{1}, versions)
+ − error('requested version does not exist');
+ − end
+ − end
+ − version = versions{idx};
+ − pl = plist({'VERSION', 'Model version'}, {idx, vt(1:2:end), paramValue.SINGLE});
+ −
+ −
+ − % add plist for this version
+ − fcn = utils.models.functionForVersion(getModelDescription, versionTable, version);
+ − pl.combine(fcn('plist'));
+ − pl.setName(sprintf('Parameter List for version: %s', version));
+ − end