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: maroi_matrix.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/marsbar-0.44/@maroi_pointlist
    
    the code of the file until where you have to start completion: function obj2 = maroi_matrix(obj, space)
% maroi_matrix method - converts roi to maroi matrix type
%
% Without space arg, returns object in native space
%
% $Id$

    
function obj2 = maroi_matrix(obj, space)
% maroi_matrix method - converts roi to maroi matrix type
%
% Without space arg, returns object in native space
%
% $Id$

params = paramfields(obj);
params.dat = obj.voxblock.dat;
params.mat = obj.voxblock.mat;

% put into maroi_matrix object
obj2 = maroi_matrix(params);

% rebase using maroi_matrix method if space argument passed
if nargin > 1
  obj2 = maroi_matrix(obj2, space);
end