comparison m-toolbox/test/test_plist_find.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 function test_plist_find()
2
3 % Test the find function of plist class.
4 %
5 % M Hueller 26-11-09
6 %
7 % $Id: test_plist_find.m,v 1.1 2009/11/26 14:03:48 mauro Exp $
8 %
9
10 % Make some parameters
11
12 p1 = param('a', 1);
13 p2 = param('b', 2);
14 p3 = param('c', 3);
15 p4 = param('a', 4);
16
17 % make plists
18 pl1 = plist([p1 p2]);
19 pl2 = plist(p3);
20 pl3 = plist([p2 p4]);
21
22 % find with no default
23 p1_f = find(pl1, 'a')
24 p2_f = find(pl1, 'b')
25 p3_f = find(pl1, 'c')
26
27 % find with no default
28 p1_f = find(pl1, 'a', 0)
29 p2_f = find(pl1, 'b', -7)
30 p3_f = find(pl1, 'c', 10)
31 p4_f = find(pl2, 'a', 0)
32 p5_f = find(pl2, 'b', -7)
33 p6_f = find(pl2, 'c', 10)
34 p7_f = find(pl3, 'a', 0)
35 p8_f = find(pl3, 'b', -7)
36 p9_f = find(pl3, 'c', 10)
37
38
39 % END