comparison m-toolbox/classes/@modelViewer/buildObject.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 obj = buildObject(mainfig)
2
3 % get model type
4 h = findobj(mainfig.handle, 'Tag', 'ModelTypeSelect');
5 models = get(h, 'String');
6 modelType = models{get(h, 'Value')};
7
8 % get model name
9 h = findobj(mainfig.handle, 'Tag', 'ModelSelect');
10 models = get(h, 'String');
11 model = models{get(h, 'Value')};
12
13 % get parameters
14 h = findobj(mainfig.handle, 'Tag', 'MODELVIEWERparamspanel');
15 pl = modelViewer.getParamsFromPanel(h);
16
17 % Pass to constructor
18 obj = [];
19 switch modelType
20 case 'ao'
21
22 pl = combine(plist('built-in', model), pl);
23 obj = feval('ao', pl);
24
25 case 'ssm'
26
27 pl = combine(plist('built-in', model), pl);
28 obj = feval('ssm', pl);
29
30 otherwise
31 error('model type %s is currently unsupported', modelType);
32 end
33 end