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: mne_write_cov.m
    path of file: ./repos/bspm/thirdparty/spm12/external/mne
    
    the code of the file until where you have to start completion: function mne_write_cov(fid,cov)
%
%
%   mne_write_cov(fid,cov)
%
%   Write a covariance matrix to an open file
%
%   fid     - an open file id
%   cov     - the covariance matrix to write
%

%
%   Author : Matti Hamalainen, MGH Martinos Center
%   License : BSD 3-clause
%
%   Revision 1.4  2007/12/10 01:02:55  msh
%   Fixed writing of a diagonal covariance matrix
%
%   Revision 1.3  2006/05/05 03:50:40  msh
%   Added routines to compute L2-norm inverse solutions.
%   Added mne_write_inverse_sol_stc to write them in stc files
%   Several bug fixes in other files
%
%   Revision 1.2  2006/05/03 18:53:06  msh
%   Approaching Matlab 6.5 backward compatibility
%
%   Revision 1.1  2006/04/29 12:44:10  msh
%   Added covariance matrix writing routines.
%
%


    
function mne_write_cov(fid,cov)
%
%
%   mne_write_cov(fid,cov)
%
%   Write a covariance matrix to an open file
%
%   fid     - an open file id
%   cov     - the covariance matrix to write
%

%
%   Author : Matti Hamalainen, MGH Martinos Center
%   License : BSD 3-clause
%
%   Revision 1.4  2007/12/10 01:02:55  msh
%   Fixed writing of a diagonal covariance matrix
%
%   Revision 1.3  2006/05/05 03:50:40  msh
%   Added routines to compute L2-norm inverse solutions.
%   Added mne_write_inverse_sol_stc to write them in stc files
%   Several bug fixes in other files
%
%   Revision 1.2  2006/05/03 18:53:06  msh
%   Approaching Matlab 6.5 backward compatibility
%
%   Revision 1.1  2006/04/29 12:44:10  msh
%   Added covariance matrix writing routines.
%
%

me='MNE:mne_write_cov';

global FIFF;
if isempty(FIFF)
   FIFF = fiff_define_constants();
end