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_inverse_sol_w.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_inverse_sol_w(stem,inv,sol)
%
% function mne_write_inverse_sol_w(stem,inv,sol)
%
% Save static inverse solution data into stc files
%
% stem      - Stem for the w files
% inv       - The inverse operator structure (can be the forward operator as well)

    
function mne_write_inverse_sol_w(stem,inv,sol)
%
% function mne_write_inverse_sol_w(stem,inv,sol)
%
% Save static inverse solution data into stc files
%
% stem      - Stem for the w files
% inv       - The inverse operator structure (can be the forward operator as well)
% sol       - The solution matrix (number of locations)
%

%
%
%   Author : Matti Hamalainen, MGH Martinos Center
%   License : BSD 3-clause
%
%   Revision 1.2  2009/03/04 22:04:31  msh
%   Fixed typos in comments
%
%   Revision 1.1  2009/03/04 03:50:15  msh
%   Added mne_write_inverse_sol_w
%
%   Revision 1.2  2006/09/14 22:12:48  msh
%   Added output of the files written.
%
%   Revision 1.1  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
%
%

me='MNE:mne_write_inverse_sol_w';
global FIFF;
if isempty(FIFF)
   FIFF = fiff_define_constants();
end