Mercurial > hg > ltpda
comparison m-toolbox/test/example_1.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 % EXAMPLE_1 A test script for the AO implementation. | |
2 % | |
3 % M Hewitson 08-02-07 | |
4 % | |
5 % $Id: example_1.m,v 1.25 2009/02/02 15:20:38 hewitson Exp $ | |
6 % | |
7 | |
8 function example_1() | |
9 | |
10 | |
11 % Make test AOs | |
12 | |
13 nsecs = 1000; | |
14 fs = 10; | |
15 | |
16 pl = plist(); | |
17 pl.append('nsecs', nsecs); | |
18 pl.append('fs', fs); | |
19 pl.append('tsfcn', 'randn(size(t))'); | |
20 | |
21 a1 = ao(pl); | |
22 a2 = ao(pl); | |
23 a3 = ao(pl); | |
24 a4 = ao(pl); | |
25 | |
26 % Make LPSD of each | |
27 | |
28 % parameter list for lpsd | |
29 pl = plist(); | |
30 pl.append('Kdes', 100); | |
31 pl.append('Jdes', 1000); | |
32 pl.append('Order', 1); | |
33 | |
34 % use lpsd | |
35 a5 = lpsd(a1, pl); a5.setName; | |
36 a6 = lpsd(a2, pl); a6.setName; | |
37 a7 = lpsd(a3, pl); | |
38 a8 = lpsd(a4, pl); | |
39 | |
40 % add and plot | |
41 a9 = a5+a6; | |
42 a9.setName; | |
43 | |
44 iplot(a9, a5) | |
45 plot(a9.hist) | |
46 | |
47 % Some further operations | |
48 a10 = a9.*a7; | |
49 a11 = a10.*a8; | |
50 | |
51 iplot(a11) | |
52 plot(a11.hist) | |
53 | |
54 save(a11, 'example1.xml') | |
55 | |
56 % Reproduce from history | |
57 a_out = rebuild(a11); | |
58 | |
59 iplot(a_out) | |
60 plot(a_out.hist) | |
61 | |
62 end |