diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/test/xml_tests/test_ao.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,40 @@
+clear all;
+
+%% AO waveform
+a1 = ao(plist('waveform', 'sine wave', 'f', 1, 'phi', 0, 'nsecs', 3600, 'fs', 10));
+
+% a1 = attachm(a1, mfilename);
+xmlfile = 'ao_wafeform.xml';
+save(a1, xmlfile);
+
+% load
+a2 = ao(xmlfile);
+
+if a1 ~= a2
+  error('### aos are not the same')
+end
+
+%% AO tsdata
+
+plt0 = plist(  'timeformat',     'yyyy-mm-dd HH:MM:SS.FFF',...
+               'timezone',       'UTC', ...
+               'utc_epoch_milli', 0);
+a1 = ao(plist('tsfcn', 'randn(size(t))', 'nsecs', 30, 'fs', fs, 't0', time(plt0)));
+
+
+%% AO cdata
+
+a1 = ao([1+3i -2 3; 4  5-3i -6; -7 8  9+1i]);
+
+%% AO fsdata
+fs = 10;
+f  = 1:1000;
+xx = randn(size(f));
+a1 = ao(fsdata(f,xx,fs));
+
+%% AO xydata
+
+x = 1:10;
+y = exp(x.^.5/2);
+
+a1 = ao(xydata(x,y));