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: sphharm.m
    path of file: ./repos/chebfun/@spherefun
    
    the code of the file until where you have to start completion: function Y = sphharm(l, m)
%SPHHARM   Real-valued, spherical harmonic of degree L, order M.
%
%   Y = SPHHARM(L, M) returns the degree L, order M real-valued 
%   spherical harmonic on the sphere.  Y is normalized so that its two-norm
    
function of
% theta. Specifically, it is a polynomial of cos(theta) or sin(theta)
% if coord=0 or coord=1, respectively. The highest degree this
% polynomial can be is l when when m=0.  So, we can resolve this using 2l+2
% samples. 

% Construct a matrix of values at the latitude-longitude grid
ll = trigpts( 2*abs(m)+2, dom(1:2) );
tt = linspace( dom(3), dom(4), 2*l+2 );
Y = spherefun( mySphHarm(l, m, ll, tt), dom );

end