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: sample.m
    path of file: ./repos/chebfun/@chebtech
    
    the code of the file until where you have to start completion: function [values, points] = sample(f, n)
%SAMPLE   Sample a CHEBTECH at appropriate Chebyshev points.
%   VALUES = SAMPLE(F, N) returns a vector VALUES of the values of F at N
%   first- or second-kind Chebyshev points (according to the type of F).

    
function [values, points] = sample(f, n)
%SAMPLE   Sample a CHEBTECH at appropriate Chebyshev points.
%   VALUES = SAMPLE(F, N) returns a vector VALUES of the values of F at N
%   first- or second-kind Chebyshev points (according to the type of F).
%
%   [VALUES, POINTS] = SAMPLE(F, N) returns also the vector POINTS at which the
%   values were computed.
%
%   [...] = SAMPLE(F) uses N = LENGTH(F).

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

    if ( nargin < 2 )
        n = length(f);
    end