Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/test/test_plist_find.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,39 @@ +function test_plist_find() + +% Test the find function of plist class. +% +% M Hueller 26-11-09 +% +% $Id: test_plist_find.m,v 1.1 2009/11/26 14:03:48 mauro Exp $ +% + +% Make some parameters + +p1 = param('a', 1); +p2 = param('b', 2); +p3 = param('c', 3); +p4 = param('a', 4); + +% make plists +pl1 = plist([p1 p2]); +pl2 = plist(p3); +pl3 = plist([p2 p4]); + +% find with no default +p1_f = find(pl1, 'a') +p2_f = find(pl1, 'b') +p3_f = find(pl1, 'c') + +% find with no default +p1_f = find(pl1, 'a', 0) +p2_f = find(pl1, 'b', -7) +p3_f = find(pl1, 'c', 10) +p4_f = find(pl2, 'a', 0) +p5_f = find(pl2, 'b', -7) +p6_f = find(pl2, 'c', 10) +p7_f = find(pl3, 'a', 0) +p8_f = find(pl3, 'b', -7) +p9_f = find(pl3, 'c', 10) + + +% END \ No newline at end of file