0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 clear all;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 %% AO waveform
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 a1 = ao(plist('waveform', 'sine wave', 'f', 1, 'phi', 0, 'nsecs', 3600, 'fs', 10));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 % a1 = attachm(a1, mfilename);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 xmlfile = 'ao_wafeform.xml';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 save(a1, xmlfile);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 % load
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 a2 = ao(xmlfile);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 if a1 ~= a2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 error('### aos are not the same')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 %% AO tsdata
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 plt0 = plist( 'timeformat', 'yyyy-mm-dd HH:MM:SS.FFF',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 'timezone', 'UTC', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 'utc_epoch_milli', 0);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 a1 = ao(plist('tsfcn', 'randn(size(t))', 'nsecs', 30, 'fs', fs, 't0', time(plt0)));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 %% AO cdata
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 a1 = ao([1+3i -2 3; 4 5-3i -6; -7 8 9+1i]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 %% AO fsdata
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 fs = 10;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 f = 1:1000;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 xx = randn(size(f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 a1 = ao(fsdata(f,xx,fs));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 %% AO xydata
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 x = 1:10;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 y = exp(x.^.5/2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 a1 = ao(xydata(x,y));
|