comparison m-toolbox/test/test_ao_scatterData.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 ao/scatterData for:
2 % - functionality
3 %
4 % M Hueller 21-04-10
5 %
6 % $Id: test_ao_scatterData.m,v 1.1 2010/04/21 04:36:00 mauro Exp $
7 %
8 function test_ao_scatterData()
9
10 %
11 % build the output object
12 a1 = ao(plist('type', 'tsdata', ...
13 'xvals', [1:10]', 'dx', 0.1*ones(10, 1), ...
14 'yvals', [2:2:20]', 'dy', 0.2*ones(10, 1), ...
15 'xunits', 's', 'yunits', 'K' ...
16 ));
17
18 a2 = ao(plist('type', 'tsdata', ...
19 'xvals', [1:10]', 'dx', 0.1*ones(10, 1), ...
20 'yvals', exp([.1:.1:1])', 'dy', 0.01*ones(10, 1), ...
21 'xunits', 's', 'yunits', 'Pa' ...
22 ));
23
24 pl = plist;
25
26 % build the output object
27 b = scatterData(a1, a2, pl)
28
29 % check that the output is a xydata object
30 if ~isa(b.data, 'xydata')
31 error('### Wrong output object class');
32 end
33
34 % check that the x values are correct
35 if ~isequal(b.x, a1.y)
36 error('### Wrong output x values');
37 end
38 % check that the dx values are correct
39 if ~isequal(b.dx, a1.dy)
40 error('### Wrong output dx values');
41 end
42 % check that the xunits are correct
43 if ~isequal(b.xunits, a1.yunits)
44 error('### Wrong output x units');
45 end
46
47 % check that the y values are correct
48 if ~isequal(b.y, a2.y)
49 error('### Wrong output y values');
50 end
51 % check that the dy values are correct
52 if ~isequal(b.dy, a2.dy)
53 error('### Wrong output dy values');
54 end
55 % check that the xunits are correct
56 if ~isequal(b.yunits, a2.yunits)
57 error('### Wrong output y units');
58 end
59 end