I need an example for the use of GUI about simulated annealing !
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Greetings everyone: I am a student to learn matlab,and want to use the GUI about simulated annealing for my Optimization computation,so I want for an simple example for the use of GUI about simulated annealing to start my study. Thanks very much!
0 Kommentare
Antworten (1)
Walter Roberson
am 2 Dez. 2013
function GUI
uicontrol('Style', 'pushbutton', 'Units', 'norm', 'Position', [.1 .9 .05 .09], 'Callback', @anneal_it);
end
function anneal_it(src, evt)
X0 = rand(1,2);
[x, fval] = sa(@function_to_anneal, X0);
fprintf('Minimum value %g at location (%g, %g)', fval, x(1), x(2));
end
function y = function_to_anneal(X)
y = (4 - 2.1*x(1)^2 + x(1)^4/3)*x(1)^2 + x(1)*x(2) + ...
(-4 + 4*x(2)^2)*x(2)^2;
end
Siehe auch
Kategorien
Mehr zu Simulated Annealing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!