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: chebkind.m
    path of file: ./repos/chebfun
    
    the code of the file until where you have to start completion: function varargout = chebkind(kind)
%CHEBKIND   Set the default Chebyshev grid type.
%   CHEBKIND 1 or CHEBKIND 2 globally sets the default grid used by the CHERBFUN
%   constructor to be Chebyshev points of the first or second kind,
%   respectively, and is equivalent to setting the default 'tech' preference in
%   CHEBFUNPREF to be either @chebtech1 or @chebtech2.
%
%   CHEBKIND by itself returns the current default Chebyshev grid type. If the
%   default technology is not Chebyshev, then zero is returned.
%
% See also CHEBTECH1, CHEBTECH2, CHEBFUNPREF, CHEBFUNPREF.SETDEFAULTS.

% Copyright 2017 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.

if ( nargin == 0 )

    
function varargout = chebkind(kind)
%CHEBKIND   Set the default Chebyshev grid type.
%   CHEBKIND 1 or CHEBKIND 2 globally sets the default grid used by the CHERBFUN
%   constructor to be Chebyshev points of the first or second kind,
%   respectively, and is equivalent to setting the default 'tech' preference in
%   CHEBFUNPREF to be either @chebtech1 or @chebtech2.
%
%   CHEBKIND by itself returns the current default Chebyshev grid type. If the
%   default technology is not Chebyshev, then zero is returned.
%
% See also CHEBTECH1, CHEBTECH2, CHEBFUNPREF, CHEBFUNPREF.SETDEFAULTS.

% Copyright 2017 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.

if ( nargin == 0 )
    tech = feval(chebfunpref().tech);
    if ( isa(tech, 'chebtech') )
        tech = class(tech);
        kind = str2double(tech(end