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