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: expm.m
    path of file: ./repos/chebfun/@coeffsDiscretization
    
    the code of the file until where you have to start completion: function [E, P] = expm(disc, t)
%EXPM    Operator exponential for coeffs-based discretization.
%   This EXPM is called by LINOP.EXPM to perform propagation of a discrete
%   initial condition via matrix exponential. The returned matrix is the
%   propagator for a discretization of the problem.
%
% See also LINOP.EXPM.

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

if ( t == 0 )
    
    % Trivial case at t = 0
    [ignored, P, ignored] = matrix(disc);
    E = eye(size(P, 2));
    
else
    
    % We need a copy of the matrix discretized without any side conditions.
    [PA, P, B] = matrix(disc);
    
    % Reduced and original degrees of freedom.

    
function [E, P] = expm(disc, t)
%EXPM    Operator exponential for coeffs-based discretization.
%   This EXPM is called by LINOP.EXPM to perform propagation of a discrete
%   initial condition via matrix exponential. The returned matrix is the
%   propagator for a discretization of the problem.
%
% See also LINOP.EXPM.

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

if ( t == 0 )
    
    % Trivial case at t = 0
    [ignored, P, ignored] = matrix(disc);
    E = eye(size(P, 2));
    
else
    
    % We need a copy of the matrix discretized without any side conditions.
    [PA, P, B] = matrix(disc);
    
    % Reduced and original degrees of freedom.
    [mRed, mOrig] = size(P);  
    
    % Construct conversion operator: 
    dims = disc.dimension; 
    S = zeros(mRed);
    olddim = 0; 
    for jj = 1:numel(dims)
       newdim = olddim + dims(jj); 
       convert = ultraS.convertmat(dims(jj), 0, disc.outputSpace );
       S(olddim+1:newdim, olddim+1:newdim) = convert;
       olddim = newdim; 
    end