Home > src > Bridge > misc > test_structfind.m

test_structfind

PURPOSE ^

TEST_STRUCTFIND - check that structfind generates the expected results

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 TEST_STRUCTFIND - check that structfind generates the expected results
 
 AUTHOR  Ronnie Johansson
 CREATED 2004-04-28
 ALTERED

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % TEST_STRUCTFIND - check that structfind generates the expected results
0002 %
0003 % AUTHOR  Ronnie Johansson
0004 % CREATED 2004-04-28
0005 % ALTERED
0006 %
0007 
0008 s = struct('number', 5, 'string', 'hej');
0009 s(2) = struct('number', 7, 'string', 'seven');
0010 s(3) = struct('number', 5, 'string', 'another');
0011 s(4) = struct('number', 7, 'string', 'hej');
0012 
0013 disp('The next line should return indices 1 and 3.');
0014 structfind(s,'number',5)
0015 
0016 disp('The next line should return indices 2 and 4.');
0017 structfind(s,'number',7)
0018 
0019 disp('The next line should return indices 1 and 4.');
0020 structfind(s,'string', 'hej')
0021 
0022 disp('The next line should return index 3.');
0023 structfind(s, 'string', 'another')
0024

Generated on Wed 16-Mar-2005 09:17:47 by m2html © 2003