From: Clemens on
Hei there,

i have a small problem with my fitting program, i want to have a real time output of the current iteration and optimization values in a text box, but the program only updates the text of the textbox at the end of the fitting...

the used code:

set(handles.out_txt, 'String', '');
function stop = outfun(x,optimValues,state)
stop = false;
guidata(hObject, handles);
switch state
case 'init'
hold on
case 'iter'
str=cellstr(get(handles.out_txt, 'String'));
str=[str; cellstr(sprintf('%s \t %s', int2str(optimValues.iteration), int2str(optimValues.firstorderopt)))];
if length(str)>6
new_str=str(2:7);
str=new_str;
end
set(handles.out_txt, 'String',str);
guidata(hObject, handles);
case 'done'
hold off
otherwise
end
end
%%fitting procedure with the optimization toolbox

options=optimset('OutputFcn', @outfun);
[param,resnorm,residual,exitflag,output,lambda,jacobian] = ...
lsqcurvefit(model, ival, handles.x, handles.y, lb, ub, options);
From: Steven Lord on

"Clemens " <greatevilhamster(a)web.de> wrote in message
news:hvd78i$cs9$1(a)fred.mathworks.com...
> Hei there,
>
> i have a small problem with my fitting program, i want to have a real time
> output of the current iteration and optimization values in a text box, but
> the program only updates the text of the textbox at the end of the
> fitting...

Include a DRAWNOW in your OutputFcn to allow MATLAB a chance to redraw the
updated text box.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: Clemens on
thank you, i was looking for exactly this command:)

Have a nice evening