x=-1:0.01:2;        % grid points along x-axes         
y=-0.5:0.01:3;      % grid points along y-axes

nx=length(x);       % size of grid along x-axes 
ny=length(y);       % siye of grid along y-axes

%
% evaluate Rosenbrock function in grid points
%

fz=zeros(nx,ny);    % intiliaze matrix size to grid size and set to zero  
for i=1:nx
  for j=1:ny
    % compute f(x(i),y(j)) and store in fz(i,j)
    fz(i,j)= 100*(y(j)-x(i)^2)^2+(1-x(i))^2;
  end
end

%
% make a contour plot for prespecified contour levels
%

figure(1);               % output next plot on window of figure 1 
hold off;                % overwrite old plot in figure 1
contour(x,y,fz',[0.1,0.5,2.5,12.5,62.5,312.5]);     % plot the function
xlabel('x');             % output 'x' along x axis
ylabel('y');             % output 'y' along y axis

%
% for a given list of points plot red circles at these points
%


xcoord=[1.2,1.2,1.2,1.2,1.2,1.2,1.2];  % x coordinates of the points 
ycoord=[1.2,1.4,1.6,1.8,2.0,2.2,2.4];  % y coordinates of the points
 
hold on;                               % plot into current picture
plot(xcoord,ycoord,'ro');              % 'ro' plots a red circle per point
