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: chebcoeffs.m
    path of file: ./repos/chebfun/@chebtech
    
    the code of the file until where you have to start completion: function out = chebcoeffs(f, N, kind)
%CHEBCOEFFS   Chebyshev polynomial coefficients of a CHEBTECH.
%   A = CHEBCOEFFS(F) returns the column vector of coefficients such that F =
%   A(1) T_0(x) + ... + A(N-1) T_{N-2}(x) + A(N) T_{N-1}(x), where T_k(x)
%   denotes the k-th Chebyshev polynomial and LENGTH(F) = N. This is equivalent
%   to GET(F, 'COEFFS').
%
%   If F is array-valued with P columns, then A is an NxP matrix.
%
%   A = CHEBCOEFFS(F, M) truncates or pads the vector A so that M coefficients
%   of the CHEBTECH F are returned.
%
%   A = CHEBCOEFFS(F, 2) and A = CHEBCOEFFS(F, M, 2) do the same as above but

    
function out = chebcoeffs(f, N, kind)
%CHEBCOEFFS   Chebyshev polynomial coefficients of a CHEBTECH.
%   A = CHEBCOEFFS(F) returns the column vector of coefficients such that F =
%   A(1) T_0(x) + ... + A(N-1) T_{N-2}(x) + A(N) T_{N-1}(x), where T_k(x)
%   denotes the k-th Chebyshev polynomial and LENGTH(F) = N. This is equivalent
%   to GET(F, 'COEFFS').
%
%   If F is array-valued with P columns, then A is an NxP matrix.
%
%   A = CHEBCOEFFS(F, M) truncates or pads the vector A so that M coefficients
%   of the CHEBTECH F are returned.
%
%   A = CHEBCOEFFS(F, 2) and A = CHEBCOEFFS(F, M, 2) do the same as above but
%   return the coefficients in the expansion of F in the Chebyshev polynomials
%   of the second kind U_k(x).
%
%   If F is array-valued with P columns, then A is an MxP matrix.
%
% See also LEGCOEFFS, TRIGCOEFFS.

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

% Return number of coefficients equal to length of f by default.
if ( (nargin < 2) || isempty(N) )
    N = length(f);
end