File:Rastrigin function.png

Summary

Description
English: Rastrigin Function
Date
Source Own work
Author Diegotorquemada
PNG development
InfoField

Source code

x = linspace(-5.12,5.12,200);
y = linspace(-5.12,5.12,200);

f = @(x,y) 10*2 + x.^2 + y.^2 - 10*cos(2*pi*x) - 10*cos(2*pi*y);

[xx,yy] = meshgrid(x,y);

zz = reshape(f(xx(:),yy(:)), 200, 200);

figure
surfc(xx,yy,zz);
shading interp;

title('Rastrigin function','FontSize',16)
axis([-5.12 5.12 -5.12 5.12 -30 85])

Licensing

Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.
Category:Self-published work#Rastrigin%20function.pngCategory:PD-self#Rastrigin%20function.png Category:Test functions (mathematical optimization) Category:Surface plots
Category:PD-self Category:PNG created with MATLAB Category:Self-published work Category:Surface plots Category:Test functions (mathematical optimization)