I need an example for the use of GUI about simulated annealing !
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Walter Roberson
le 2 Déc 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
Voir également
Catégories
En savoir plus sur Simulated Annealing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!