function index = findstrinstruct(S,field,string)
% index = findstrinstruct(S,field,string)
%
% find INDEX into a structure S for which S.FIELD matches STRING
%
% John Wilkin - Nov 2018
%
% Copyright (c) 2021 - John L. Wilkin - jwilkin@rutgers.edu
% $Id$

index = find(arrayfun(@(n) strcmp(S(n).(field),string), 1:numel(S)));
  
