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: test_chebmatrix.m
    path of file: ./repos/chebfun/tests/linop
    
    the code of the file until where you have to start completion: function pass = test_chebmatrix

% TODO: Tests 1 and 2 assume a chebcolloc2 discretization.

pref = cheboppref();
pref.discretization = @chebcolloc2;

    
function pass = test_chebmatrix

% TODO: Tests 1 and 2 assume a chebcolloc2 discretization.

pref = cheboppref();
pref.discretization = @chebcolloc2;

%% Building blocks
dom = [-2 -0.5 1 2];
I = operatorBlock.eye(dom);
D = operatorBlock.diff(dom);
Z = operatorBlock.zeros(dom);
x = chebfun('x', dom);
u = sin(x.^2);
U = operatorBlock.mult(u);   

D5 = [ 
  -5.499999999999999   6.828427124746189  -2.000000000000000   1.171572875253810  -0.500000000000000
  -1.707106781186547   0.707106781186547   1.414213562373095  -0.707106781186548   0.292893218813452
   0.500000000000000  -1.414213562373095                   0   1.414213562373095  -0.500000000000000
  -0.292893218813452   0.707106781186548  -1.414213562373095  -0.707106781186547   1.707106781186547
   0.500000000000000  -1.171572875253810   2.000000000000000  -6.828427124746189   5.499999999999999
];

%%
A = [ I,Z; D,U ];
M = matrix(A, [5 5 5], pref);
DD = blkdiag(2/1.5*D5,2/1.5*D5,2/1*D5);
[xx, ww] = chebpts([5 5 5], dom);
UU = diag(u(xx));

err(1) = norm( M - [ eye(15), zeros(15); DD, UU ]);

%% more complicated chebmatrix
A = [ I, x, -3*I; 
    functionalBlock.sum(dom), 5, functionalBlock.feval(dom(end