You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: putlabel.m
    path of file: ./repos/bspm/thirdparty/corr_toolbox_v2/LIBRA
    
    the code of the file until where you have to start completion: function putlabel(x,y,names,z,znames)

%PUTLABEL plots user-specified labels to the observations in a two- or 
%  a three-dimensional figure.
%  If no labels are given, the indices are plotted.
%
% Required input arguments:
%    x : x-coordinates of the data
%    y : y-coordinates of the data
% 

    
function putlabel(x,y,names,z,znames)

%PUTLABEL plots user-specified labels to the observations in a two- or 
%  a three-dimensional figure.
%  If no labels are given, the indices are plotted.
%
% Required input arguments:
%    x : x-coordinates of the data
%    y : y-coordinates of the data
% 
% Optional input arguments:
%   names : labels to be added on the plot. They must be listed in a
%           column vector. 
%       z : z-coordinates of the data
%  znames : labels to be added on the 3D-plot. They must be listed in a
%           columnvector.
%
% This function is part of LIBRA: the Matlab Library for Robust Analysis,
% available at: 
%              http://wis.kuleuven.be/stat/robust.html
%
% I/O: putlabel(x,y,names,z,znames)
%
% Written by S. Verboven on 01/10/2002
% Last update on 18/02/2004

xrange=get(gca,'Xlim');
range=xrange(2)-xrange(1);
if nargin<3
   for i=1:length(x)
      text(x(i)+range/50,y(i),num2str(i));
   end