diff m-toolbox/test/test_plist_mfind.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_mfind.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,40 @@
+function test_plist_mfind()
+
+% Test the mfind function of plist class.
+% 
+% M Hueller 26-11-09
+% 
+% $Id: test_plist_mfind.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]);
+
+% mfind with one argument
+p1_f = mfind(pl1, 'a')
+p2_f = mfind(pl1, 'b')
+p3_f = mfind(pl1, 'c')
+
+% mfind with more than one argument
+p1_f = mfind(pl1, 'a', 'b')
+p2_f = mfind(pl1, 'b', 'c')
+p3_f = mfind(pl1, 'a', 'a')
+p4_f = mfind(pl2, 'a', 'a')
+p5_f = mfind(pl2, 'b', 'a', 'c')
+p6_f = mfind(pl2, 'c')
+p7_f = mfind(pl3, 'a', 'b', 'c')
+p8_f = mfind(pl3, 'b', 'a', 'c')
+p9_f = mfind(pl3, 'b', 'd')
+
+
+
+% END
\ No newline at end of file