I need an example for the use of GUI about simulated annealing !
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Walter Roberson
2013년 12월 2일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulated Annealing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!