% Dolan's Function # 1
% Range of initial points: -100 <= x <= 100
% Global minima: x=7.810207524564704
% f(x)=-703.7287810900712
% Coded by: Ali R. Alroomi | Last Update: 05 August 2015 | www.al-roomi.org
 
clear
clc
warning off
 
xmin=-100;
xmax=100;
R=100000; % steps resolution
x=xmin:(xmax-xmin)/R:xmax;
 
for i=1:length(x)
    f(i)=x(i)^4-12*x(i)^3+15*x(i)^2+56*x(i)-60;
end
 
plot(x,f,'r','LineWidth',2);grid;set(gca,'FontSize',12);axis([-4 10 -774 2000]);
xlabel('x','FontName','Times','FontSize',20,'FontAngle','italic');
ylabel('f(x)','FontName','Times','FontSize',20,'FontAngle','italic');