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_eeg_inv_checkmeshes.m
    path of file: ./repos/spm
    
    the code of the file until where you have to start completion: function [h_ctx,h_iskl,h_oskl,h_slp] = spm_eeg_inv_checkmeshes(varargin)
% Display tesselated surfaces of cortex, skull and scalp
% FORMAT [h_ctx,h_iskl,h_oskl,h_slp] = spm_eeg_inv_checkmeshes(S)
% S      - input data struct (optional)
%
% h_ctx  - handle to cortex patch
% h_iskl - handle to inner skull patch
% h_oskl - handle to outer skull patch
% h_slp  - handle to scalp patch
%__________________________________________________________________________

% Jeremie Mattout
% Copyright (C) 2008-2022 Wellcome Centre for Human Neuroimaging



    
function [h_ctx,h_iskl,h_oskl,h_slp] = spm_eeg_inv_checkmeshes(varargin)
% Display tesselated surfaces of cortex, skull and scalp
% FORMAT [h_ctx,h_iskl,h_oskl,h_slp] = spm_eeg_inv_checkmeshes(S)
% S      - input data struct (optional)
%
% h_ctx  - handle to cortex patch
% h_iskl - handle to inner skull patch
% h_oskl - handle to outer skull patch
% h_slp  - handle to scalp patch
%__________________________________________________________________________

% Jeremie Mattout
% Copyright (C) 2008-2022 Wellcome Centre for Human Neuroimaging


%-Initialisation
%--------------------------------------------------------------------------
[D,val] = spm_eeg_inv_check(varargin{:});
try
    %disp(D.inv{val}.mesh);
    mesh  = spm_eeg_inv_transform_mesh(eye(4), D.inv{val}.mesh);
    Mctx  = mesh.tess_ctx;
    Miskl = mesh.tess_iskull;
    Moskl = mesh.tess_oskull;
    Mslp  = mesh.tess_scalp;
catch
    spm('alert!','Please create meshes',mfilename);
    return
end