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: spm_interp.m
    path of file: ./repos/bspm/thirdparty/spm12
    
    the code of the file until where you have to start completion: function [x] = spm_interp(x,r)
% 1 or 2-D array interpolation
% FORMAT [x] = spm_interp(x,r)
% x - array
% r - interpolation rate
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Karl Friston
% $Id: spm_interp.m 5219 2013-01-29 17:07:07Z spm $

% interpolate
%--------------------------------------------------------------------------
[n,m] = size(x);

if n > 1 && m > 1  % matrix

    
function [x] = spm_interp(x,r)
% 1 or 2-D array interpolation
% FORMAT [x] = spm_interp(x,r)
% x - array
% r - interpolation rate
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Karl Friston
% $Id: spm_interp.m 5219 2013-01-29 17:07:07Z spm $

% interpolate
%--------------------------------------------------------------------------
[n,m] = size(x);

if n > 1 && m > 1  % matrix
    
    X     = zeros(r*n,m);
    for i = 1:m
        X(:,i) = interpolate(x(:,i),r);
    end