www.gusucode.com > globaloptim 案例源码程序 matlab代码 > globaloptim/ObtainAllOutputsExample.m

    %% Obtain All Outputs
% Obtain all the outputs of a simulated annealing minimization.
%%
% Plot De Jong's fifth function.

% Copyright 2015 The MathWorks, Inc.

dejong5fcn
%%
% Start |simulannealbnd| starting at the point |[0,0]|, and set lower
% bounds of -64 and upper bounds of 64 on each component.
fun = @dejong5fcn;
x0 = [0,0];
lb = [-64,-64];
ub = [64,64];
[x,fval,exitflag,output] = simulannealbnd(fun,x0,lb,ub)

%%
% The |simulannealbnd| algorithm uses the MATLAB(R) random number stream,
% so you might obtain a different result.