function val = assoc(keys, vals)
% ASSOC Like the built-in strmatch, but uses exact matching and accepts a cell array of keys to lookup
% posns = assoc(keys, vals)

fprintf('warning: use stringmatch instead of assoc\n');

if ~iscell(keys), keys = {keys}; end
nkeys = length(keys);
posns = zeros(1, nkeys);
for i=1:nkeys
  pos = strmatch(keys{i}, vals, 'exact');
  assert(length(pos)==1);
  posns(i) = pos;
end

