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: fiff_finish_writing_raw.m
    path of file: ./repos/fieldtrip/external/mne
    
    the code of the file until where you have to start completion: function fiff_finish_writing_raw(fid)
%
% function fiff_finish_writing_raw(fid)
%
% fid        of an open raw data file
%
%

%

    
function fiff_finish_writing_raw(fid)
%
% function fiff_finish_writing_raw(fid)
%
% fid        of an open raw data file
%
%

%
%   Author : Matti Hamalainen, MGH Martinos Center
%   License : BSD 3-clause
%
%
% Revision 1.2  2008/05/08 13:35:09  msh
% Ending FIFFB_MEAS was missing
%
% Revision 1.1  2007/11/07 16:05:05  msh
% New routines for writing raw files
%

me = 'MNE:fiff_finish_writing_raw';
if nargin ~= 1
    error(me, 'File id required as an argument');
end

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