Ackley Function 3D plot
显示 更早的评论
Ackley function has the formula of 

I have been trying to plot the same but the function is not running. Please help me to understand how to plot. Thanks in advance
function [out]=ackley(in)
x=in;
e=exp(1);
out = (20 + e-20*exp(-0.2*sqrt((1/2).*sum(x.^2,2)))-exp((1/2).*sum(cos(2*pi*x),2)));
return
x = -3:3;
y = -3:3;
[X,Y] = meshgrid(x,y);
in = [X(:), Y(:)];
out = ackley(in);
Z = reshape(out, size(X));
surf(X, Y, Z);
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Estimation Filters 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
