% Suharev's Function 
% Range of initial points: 0 <= x <= 1
% Many global minimum happen at: (1/x)=(3*pi/2 + 2*pi*n) , n=0,1,2,3,...
% f(x)=-1
% Coded by: Ali R. Alroomi | Last Update: 18 Jan. 2015 | www.al-roomi.org
 
clear
clc
warning off
 
xmin=0;
xmax=1;
R=100000; % steps resolution
x=xmin:(xmax-xmin)/R:xmax;
    
for i=1:length(x)
    f(i)=sin(1/x(i));
end
 
plot(x,f,'r');grid;set(gca,'FontSize',12);
xlabel('x','FontName','Times','FontSize',20,'FontAngle','italic');
ylabel('f(x)','FontName','Times','FontSize',20,'FontAngle','italic');