diff m-toolbox/test/test_acos.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/test_acos.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,51 @@
+% TEST_ACOS test acos() operator for analysis objects.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION: TEST_ACOS Test acos() operator for analysis objects with
+%                       tsdata, fsdata cdata and xydata
+%
+% CALL:    test_acos;
+%
+% HISTORY: 22-05-2007 Diepholz
+%             Creation.
+%
+% VERSION: % $Id: test_acos.m,v 1.4 2009/02/02 15:20:38 hewitson Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function test_acos()
+  % Create tsdata with a sinewave
+  pl = plist('fs', 100, 'nsecs', 5, 'waveform', 'sine wave', 'f', 1.23, 'phi', 30);
+  
+  ts_data = ao(pl);
+  
+  % Create cdata with a 3x3 Matrix
+  matr = [1 2 3; 4  5 6; 7 8  9];
+  
+  c_data = cdata(matr);
+  c_data = ao(c_data);
+  
+  % Create xydata with a exp function
+  x = 1:1000;
+  y = exp(x.^.5/2);
+  
+  xy_data = xydata(x,y);
+  xy_data = ao(xy_data);
+  
+  % Create fsdata
+  warning('test_acos is not working with fsdata');
+  
+  % Some tests
+  ao_out = acos(ts_data);
+  ao_out = acos(ts_data, ts_data, ts_data);
+  ao_out = acos(ts_data, c_data, xy_data);
+  
+  % Create different parameter lists to control the acos test
+  pl1 = plist('xdata', 't', 'ydata', 'x');
+  ao_out = acos(ts_data, pl1);
+  
+  pl2 = plist('xdata', 'x', 'ydata', 'y');
+  ao_out = acos(xy_data, pl2);
+  
+end
\ No newline at end of file