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: colormap_cpt.m
    path of file: ./repos/CutAndDisplace/SharedFunctions
    
    the code of the file until where you have to start completion: function cmap = colormap_cpt(cpt,varargin)
% COLORMAP_CPT   builds a MATLAB colormap from a cpt file 
%
%    colormap_cpt(name,<nSteps>)
%
% name   = the name of a colormap from the cpt-city website, see:
%          <a href="http://soliton.vm.bytemark.co.uk/pub/cpt-city/">http://soliton.vm.bytemark.co.uk/pub/cpt-city/</a>
% nSteps = number of colorsteps (optional)
%
% Note:
%  make sure to have downloaded the cpt-city package from:
%  <a href="http://soliton.vm.bytemark.co.uk/pub/cpt-city/pkg/"
%     >http://soliton.vm.bytemark.co.uk/pub/cpt-city/pkg/</a>
%  Unpack and add folder to the MATLAB search path
%
% Example:
%
% cmap = colormap_cpt('temperature');
% subplot(3,1,[1 2])
%   colormap(cmap)
%   [x,y,z] = cylinder(100:-1:10);surf(x,y,z);
%   camlight(300,20); view([-60 32]); shading flat;

    
function cmap = colormap_cpt(cpt,varargin)
% COLORMAP_CPT   builds a MATLAB colormap from a cpt file 
%
%    colormap_cpt(name,<nSteps>)
%
% name   = the name of a colormap from the cpt-city website, see:
%          <a href="http://soliton.vm.bytemark.co.uk/pub/cpt-city/">http://soliton.vm.bytemark.co.uk/pub/cpt-city/</a>
% nSteps = number of colorsteps (optional)
%
% Note:
%  make sure to have downloaded the cpt-city package from:
%  <a href="http://soliton.vm.bytemark.co.uk/pub/cpt-city/pkg/"
%     >http://soliton.vm.bytemark.co.uk/pub/cpt-city/pkg/</a>
%  Unpack and add folder to the MATLAB search path
%
% Example:
%
% cmap = colormap_cpt('temperature');
% subplot(3,1,[1 2])
%   colormap(cmap)
%   [x,y,z] = cylinder(100:-1:10);surf(x,y,z);
%   camlight(300,20); view([-60 32]); shading flat;
%   material shiny; lighting gouraud; colorbar
% subplot(3,1,3)
%   plot(cmap); axis([1 size(cmap,1) -.01 1.01])
%
% See also: colormaps

% This tools is part of <a href="http://OpenEarth.Deltares.nl">OpenEarthTools</a>.
% OpenEarthTools is an online collaboration to share and manage data and 
% programming tools in an open source, version controlled environment.
% Sign up to recieve regular updates of this function, and to contribute 
% your own tools.

%   --------------------------------------------------------------------
%   Copyright (C) 2009 Deltares for Building with Nature
%       Thijs Damsma
%
%       Thijs.Damsma@deltares.nl	
%
%       Deltares
%       P.O. Box 177
%       2600 MH Delft
%       The Netherlands
%
%   This library is free software: you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as published by
%   the Free Software Foundation, either version 3 of the License, or
%   (at your option) any later version.
%
%   This library is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public License
%   along with this library.  If not, see <http://www.gnu.org/licenses/>.
%   --------------------------------------------------------------------

% $Id: colormap_cpt.m,v 1.1 2011/05/26 18:23:16 jjg Exp jjg $
% $Date: 2011/05/26 18:23:16 $
% $Author: jjg $
% $Revision: 1.1 $
% $HeadURL: https://repos.deltares.nl/repos/OpenEarthTools/trunk/MATLAB/general/color_fun/colormaps/colormap_cpt.m $
% $Keywords: $

%% adjust of *.cpt filename so you can copy paste it from the website
cpt = strrep(cpt,' ','_');
if ~strcmpi(cpt(end