function options=read2()

% strings necessários
onoff={'on','off'};
otimmet={'dfp', 'gillmurray', 'steepdesc', 'bfgs'};
dipl={'off','iter','final'};
lins={'cubicpoly', 'quadcubic'};
merit={'singleobj', 'multiobj'}; 

% leitura dos popups
for i=1:12
   if i<10
      popval(i)=get(findobj(gcf,'tag',['popup0' int2str(i)]),'value');
   else
      popval(i)=get(findobj(gcf,'tag',['popup' int2str(i)]),'value');
   end
end

% leitura dos edits
for n = 1:15
   if n<10
      edit=get(findobj(gcf,'tag',['edit0' int2str(n)]),'string');
   else
      edit=get(findobj(gcf,'tag',['edit' int2str(n)]),'string');
   end
   if ~isempty(edit)
      edit2=str2num(edit);
      eval(['valor' num2str(n) ' = edit2;' ])
   else
      eval(['valor' num2str(n) ' = [];' ])
   end
end


options=optimset('DerivativeCheck', onoff{popval(1)}, 'Diagnostics', onoff{popval(2)}, 'DiffMaxChange',valor1, 'DiffMinChange', valor2, ...
   'Display',dipl{popval(3)}, 'GoalsExactAchieve',valor3,'GradConstr',onoff{popval(4)}, 'GradObj',onoff{popval(5)}, 'Hessian', onoff{popval(6)}, ...
   'HessPattern',valor4, 'HessUpdate', otimmet{popval(7)}, 'JacobPattern', valor5, 'Jacobian', onoff{popval(8)}, 'LargeScale', onoff{popval(9)}, ...
   'LevenbergMarquardt',onoff{popval(10)}, 'LineSearchType', lins{popval(11)}, 'MaxFunEvals', valor6, 'MaxIter', valor7, 'MaxPCGIter', valor8, ...
   'MeritFunction',merit{popval(12)}, 'MinAbsMax', valor9, 'PrecondBandWidth', valor10, 'TolCon', valor11, 'TolFun', valor12, ...
   'TolPCG', valor13, 'TolX', valor14, 'TypicalX', valor15);

nome=uiputfile('*.*', 'Save As');

writearq(options,nome)