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: chebcoeffs2.m
    path of file: ./repos/chebfun/@chebfun2
    
    the code of the file until where you have to start completion: function varargout = chebcoeffs2(f)
%CHEBCOEFFS2    Bivariate Chebyshev coefficients

    
function varargout = chebcoeffs2(f)
%CHEBCOEFFS2    Bivariate Chebyshev coefficients
%   X = CHEBCOEFFS2(F) returns the matrix of bivariate coefficients such that
%       F= sum_{i=0}^{n-1} ( sum_{j=0}^{n-1} X(i+1,j+1) T_i(y) T_j(x) ).
%
%   [A, D, B] = CHEBCOEFFS2( f ) returns the same coefficients keeping them in
%   low rank form, i.e., X = A * D * B'.
%
% See also PLOTCOEFFS2, CHEBCOEFFS.

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

if ( isempty(f) )
    varargout = { [ ] }; 
    return
end