0001
0002
0003
0004
0005
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