% returns the index of an output field
%
% n = getFieldOut(opt, name, outName)
% name - optic name or serial number
% outName - output name
% n - field index
%
% Example:
% n = getFieldOut(opt, 'PR', 'fr');

function n = getFieldOut(opt, name, outName)

  sn = getSerialNum(opt, name);					% optic number
  np = getPortNum(opt, outName, opt.optic(sn).outNames);	% port number
  nl = opt.optic(sn).out(np);					% link number
  n = opt.link(nl).m;						% field number
