function stop = BR_outfun(x,optimValues,state)

persistent tr
if isempty(tr)
    tr = [];
end

stop = false;

switch state
    case 'init'
        hold on
    case 'iter'
        [x',optimValues.fval]
        tr = [tr; x',optimValues.fval];
    case 'done'
        hold off
        save TR tr
    otherwise
end
