I'm trying to run this program through Optimtool but getting the errors - "Undefined function 'symsum' for input arguments of type double". Can somebody help me with this code?
이전 댓글 표시
Attached Picture is the actual question. I want to perform a Simulated Annealing algorithm on this question to find the number of iterations occurring before reaching the final value. Here is the code that I wrote -
function y = SAcode(N)
syms i
y = symsum((N(1)-3).^2+(N(2).^(i)-3).^2 +(N(3).^(i)-3).^2,i,1,N(1));
end
ObjectiveFunction = @SAcode;
n = [2 2.4 3.6];
lb = [1 1 1];
ub = [5 5 5];
[N,fval,exitFlag,output] = simulannealbnd(ObjectiveFunction,n,lb,ub);
fprintf('The number of iterations was : %d\n', output.iterations);
fprintf('The number of function evaluations was : %d\n', output.funccount);
fprintf('The best function value found was : %g\n', fval);
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Simulated Annealing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!