Mercurial > hg > ltpda
comparison m-toolbox/classes/+utils/@models/getBuiltinModelSearchPaths.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 function varargout = getBuiltinModelSearchPaths(varargin) | |
2 | |
3 % Get a list of user model directories | |
4 prefs = getappdata(0, 'LTPDApreferences'); | |
5 | |
6 % support the old stand-alone built-in models directories | |
7 searchPaths = prefs.getModelsPrefs.getSearchPaths; | |
8 paths = {}; | |
9 for kk=0:searchPaths.size-1 | |
10 paths = [paths {char(searchPaths.get(kk))}]; | |
11 end | |
12 | |
13 % and add the new extension modules built-in models | |
14 searchPaths = prefs.getExtensionsPrefs.getSearchPaths; | |
15 for kk=0:searchPaths.size-1 | |
16 paths = [paths {fullfile(char(searchPaths.get(kk)), 'models')}]; | |
17 end | |
18 | |
19 % Always look in the system directory | |
20 loc = mfilename('fullpath'); | |
21 idx = strfind(loc, filesep); | |
22 loc = loc(1:idx(end)); | |
23 loc = fullfile(loc, '..', '..', '..', 'm', 'built_in_models'); | |
24 paths = [reshape(paths, 1, []) {loc}]; | |
25 | |
26 varargout{1} = paths; | |
27 | |
28 end |