Mercurial > hg > ltpda
comparison m-toolbox/classes/@ltpda_uoh/fromModel.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children | bc767aaa99a8 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % FROMMODEL Construct an a built in model | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % FUNCTION: fromModel | |
5 % | |
6 % DESCRIPTION: Construct an ltpda uder objects with history from a | |
7 % built-in model | |
8 % | |
9 % CALL: a = fromModel(a, pl) | |
10 % | |
11 % PARAMETER: pl: Parameter list object | |
12 % | |
13 % VERSION: $Id: fromModel.m,v 1.13 2011/08/15 12:59:04 hewitson Exp $ | |
14 % | |
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
16 | |
17 function obj = fromModel(obj, pl) | |
18 | |
19 [obj, ii, fcnname] = fromModel@ltpda_uo(obj, pl); | |
20 % Add history | |
21 try | |
22 feval(fcnname, 'info'); | |
23 catch | |
24 % if the model doesn't respond to an 'info' call, then it is an old | |
25 % style model and we need to add history. | |
26 obj.addHistory(ii, pl, [], []); | |
27 end | |
28 | |
29 % Set object properties | |
30 obj.setObjectProperties(pl); | |
31 | |
32 end | |
33 |