% Problem # 1 (or Rokne's Function # 1)
% Range of initial points: -1.5 <= x <= 11
% Global maxima: x=2976.323333333334
% f(x)=10
% Coded by: Ali R. Alroomi | Last Update: 04 March 2015 | www.al-roomi.org
 
clear
clc
warning off
 
xmin=-1.5;
xmax=11;
R=100000; % steps resolution
x=xmin:(xmax-xmin)/R:xmax;
 
for i=1:length(x)
    f(i)=(-1/6)*x(i)^6+(52/25)*x(i)^5-(39/80)*x(i)^4-(71/10)*x(i)^3+(79/20)*x(i)^2+x(i)-(1/10);
end
 
plot(x,f,'r','LineWidth',2);grid;set(gca,'FontSize',12);
xlabel('x','FontName','Times','FontSize',20,'FontAngle','italic');
ylabel('f(x)','FontName','Times','FontSize',20,'FontAngle','italic');