function Info = selectBestRun(Info)
% Selects the best run from Info struct generated by systune

%   Copyright 2009-2014 The MathWorks, Inc.
if numel(Info)>1
    % Selects best run from SYSTUNE
    g = [Info.g];
    iFeas = find(g<1);
    if isempty(iFeas)
        [~,iBest] = min(g);
    else
        [~,iMin] = min([Info(iFeas).f]);
        iBest = iFeas(iMin);
    end
    Info = Info(iBest);
end