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: qr.m
    path of file: ./repos/chebfun/@bndfun
    
    the code of the file until where you have to start completion: function [Q, R, E] = qr(f, varargin)
%QR   QR factorisation of an array-valued BNDFUN.
%   [Q, R] = QR(F) returns a QR factorisation of F such that F = Q*R, where the
%   BNDFUN Q is orthogonal (with respect to the continuous L^2 norm on the
%   domain of F) and of the same size as F and R is an m x m upper-triangular
%   matrix when F has m columns.
%
%   [Q, R, E] = QR(F) produces unitary Q, upper-triangular R, and a permutation
%   matrix E so that F*E = Q*R. The column permutation E is chosen to reduce
%   fill-in in R.
%
%   [Q, R, E] = QR(F, 'vector') returns the permutation information as a vector
%   instead of a matrix.  That is, E is a row vector such that F(:,E) = Q*R.
%   Similarly, [Q, R, E] = QR(F, 'matrix') returns a permutation matrix E. This
%   is the default behavior.

% Copyright 2017 by The University of Oxford and The Chebfun Developers. 

    
function [Q, R, E] = qr(f, varargin)
%QR   QR factorisation of an array-valued BNDFUN.
%   [Q, R] = QR(F) returns a QR factorisation of F such that F = Q*R, where the
%   BNDFUN Q is orthogonal (with respect to the continuous L^2 norm on the
%   domain of F) and of the same size as F and R is an m x m upper-triangular
%   matrix when F has m columns.
%
%   [Q, R, E] = QR(F) produces unitary Q, upper-triangular R, and a permutation
%   matrix E so that F*E = Q*R. The column permutation E is chosen to reduce
%   fill-in in R.
%
%   [Q, R, E] = QR(F, 'vector') returns the permutation information as a vector
%   instead of a matrix.  That is, E is a row vector such that F(:,E) = Q*R.
%   Similarly, [Q, R, E] = QR(F, 'matrix') returns a permutation matrix E. This
%   is the default behavior.

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

% Deal with empty case:
if ( isempty(f) )
    Q = [];
    R = [];
    E = [];
    return
end