Mercurial > hg > ltpda
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % TEST_ACOS test acos() operator for analysis objects. | |
2 % | |
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
4 % | |
5 % DESCRIPTION: TEST_ACOS Test acos() operator for analysis objects with | |
6 % tsdata, fsdata cdata and xydata | |
7 % | |
8 % CALL: test_acos; | |
9 % | |
10 % HISTORY: 22-05-2007 Diepholz | |
11 % Creation. | |
12 % | |
13 % VERSION: % $Id: test_acos.m,v 1.4 2009/02/02 15:20:38 hewitson Exp $ | |
14 % | |
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
16 | |
17 function test_acos() | |
18 % Create tsdata with a sinewave | |
19 pl = plist('fs', 100, 'nsecs', 5, 'waveform', 'sine wave', 'f', 1.23, 'phi', 30); | |
20 | |
21 ts_data = ao(pl); | |
22 | |
23 % Create cdata with a 3x3 Matrix | |
24 matr = [1 2 3; 4 5 6; 7 8 9]; | |
25 | |
26 c_data = cdata(matr); | |
27 c_data = ao(c_data); | |
28 | |
29 % Create xydata with a exp function | |
30 x = 1:1000; | |
31 y = exp(x.^.5/2); | |
32 | |
33 xy_data = xydata(x,y); | |
34 xy_data = ao(xy_data); | |
35 | |
36 % Create fsdata | |
37 warning('test_acos is not working with fsdata'); | |
38 | |
39 % Some tests | |
40 ao_out = acos(ts_data); | |
41 ao_out = acos(ts_data, ts_data, ts_data); | |
42 ao_out = acos(ts_data, c_data, xy_data); | |
43 | |
44 % Create different parameter lists to control the acos test | |
45 pl1 = plist('xdata', 't', 'ydata', 'x'); | |
46 ao_out = acos(ts_data, pl1); | |
47 | |
48 pl2 = plist('xdata', 'x', 'ydata', 'y'); | |
49 ao_out = acos(xy_data, pl2); | |
50 | |
51 end |