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: chebpolyval2.m
    path of file: ./repos/chebfun/@chebfun2
    
    the code of the file until where you have to start completion: function varargout = chebpolyval2( f, varargin )
%CHEBPOLYVAL2      Values on a tensor product grid.
%   X = CHEBPOLYVAL2(F) returns the matrix of values of F on a tensor
%   product grid.
%
%   [U, D, V] = CHEBPOLYVAL2(F) returns the low rank representation of the
%   values of F on a tensor product grid. X = U * D * V'.
%
%   [U, D, V] = CHEBPOLYVAL2(F,M,N) returns the values of F on a M-by-N
%   tensor product grid.
%
% See also CHEBCOEFFS2, PLOTCOEFFS2. 


    
function varargout = chebpolyval2( f, varargin )
%CHEBPOLYVAL2      Values on a tensor product grid.
%   X = CHEBPOLYVAL2(F) returns the matrix of values of F on a tensor
%   product grid.
%
%   [U, D, V] = CHEBPOLYVAL2(F) returns the low rank representation of the
%   values of F on a tensor product grid. X = U * D * V'.
%
%   [U, D, V] = CHEBPOLYVAL2(F,M,N) returns the values of F on a M-by-N
%   tensor product grid.
%
% See also CHEBCOEFFS2, PLOTCOEFFS2. 

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

% Empty check. 
if ( isempty( f ) )
    varargout = { [] }; 
    return
end