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?
Afficher commentaires plus anciens
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);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Simulated Annealing dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!