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_convmtx.m
    path of file: ./repos/bspm/thirdparty/spm8
    
    the code of the file until where you have to start completion: function t = spm_convmtx(v,n,OPT)
% as for convmtx but for sparse matrices
% FORMAT t = spm_convmtx(C,N,OPT)
%
% OPT  - 'circular' boundary conditions
%      - 'square'   top and tail convolution matrix
%
%--------------------------------------------------------------------------
%   CONVMTX(C,N) returns the convolution matrix for vector C.
%   If C is a column vector and X is a column vector of length N,
%   then CONVMTX(C,N)*X is the same as CONV(C,X).
%   If R is a row vector and X is a row vector of length N,
%   then X*CONVMTX(R,N) is the same as CONV(R,X).
%   See also CONV.%
%   With the circular option the convolution matrix is reduced to N X N
%__________________________________________________________________________
% Copyright (C) 1988-2004 The MathWorks, Inc.
 
% L. Shure and T. Krauss
% $Id: spm_convmtx.m 4567 2011-11-23 12:13:01Z spm $

    
function t = spm_convmtx(v,n,OPT)
% as for convmtx but for sparse matrices
% FORMAT t = spm_convmtx(C,N,OPT)
%
% OPT  - 'circular' boundary conditions
%      - 'square'   top and tail convolution matrix
%
%--------------------------------------------------------------------------
%   CONVMTX(C,N) returns the convolution matrix for vector C.
%   If C is a column vector and X is a column vector of length N,
%   then CONVMTX(C,N)*X is the same as CONV(C,X).
%   If R is a row vector and X is a row vector of length N,
%   then X*CONVMTX(R,N) is the same as CONV(R,X).
%   See also CONV.%
%   With the circular option the convolution matrix is reduced to N X N
%__________________________________________________________________________
% Copyright (C) 1988-2004 The MathWorks, Inc.
 
% L. Shure and T. Krauss
% $Id: spm_convmtx.m 4567 2011-11-23 12:13:01Z spm $
 
if nargin < 3;
    OPT = 'none';
end