Mercurial > hg > ltpda
comparison m-toolbox/classes/+utils/@models/functionForVersion.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 % FUNCTIONFORVERSION returns the function handle for a given version string | |
2 % | |
3 % CALL: utils.models.functionForVersion(@getModelDescription, @versionTable, version, @getFileVersion) | |
4 % | |
5 function fcn = functionForVersion(getModelDescription, versionTable, version, getVersion) | |
6 if isa(versionTable, 'function_handle') | |
7 vt = versionTable(); | |
8 else | |
9 vt = versionTable; | |
10 end | |
11 idx = find(strcmp(vt, version)); | |
12 if isempty(idx) | |
13 error('requested version does not exist'); | |
14 end | |
15 fcn = vt{idx+1}; | |
16 end |