Mercurial > hg > ltpda
comparison m-toolbox/classes/@ao/fromXYFcn.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 % FROMXYFCN Construct an ao from a function f(x) string | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % FUNCTION: fromXYfcn | |
5 % | |
6 % DESCRIPTION: Construct an ao from a function f(x) string | |
7 % | |
8 % CALL: a = fromXYfcn(pl) | |
9 % | |
10 % PARAMETER: pl: Parameter list object | |
11 % | |
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
13 function a = fromXYFcn(a, pli) | |
14 | |
15 VERSION = '$Id: fromXYFcn.m,v 1.9 2011/08/16 06:06:17 hewitson Exp $'; | |
16 | |
17 % get AO info | |
18 ii = ao.getInfo('ao', 'From XY Function'); | |
19 | |
20 % Set the method version string in the minfo object | |
21 ii.setMversion([VERSION '-->' ii.mversion]); | |
22 | |
23 % Add default values | |
24 pl = applyDefaults(ii.plists, pli); | |
25 pl.getSetRandState(); | |
26 | |
27 % Get parameters | |
28 fcn = find(pl, 'xyfcn'); | |
29 x = find(pl, 'X'); | |
30 | |
31 % Make data | |
32 ts = xydata(x,eval([fcn ';'])); | |
33 | |
34 % Make an analysis object | |
35 a.data = ts; | |
36 | |
37 % Add history | |
38 a.addHistory(ii, pl, [], []); | |
39 | |
40 % Set xunits | |
41 a.setXunits(pl.find('xunits')); | |
42 | |
43 % Set yunits | |
44 a.setYunits(pl.find('yunits')); | |
45 | |
46 % Set object properties from the plist | |
47 a.setObjectProperties(pl); | |
48 | |
49 end | |
50 | |
51 |