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: osp_plotScatter.m
    path of file: ./repos/osprey/plot
    
    the code of the file until where you have to start completion: function [out_scat] = osp_plotScatter(MRSCont,model,quant,metab,corrData,corrDataName,VoxelIndex,basis)
%% [out_scat] = osp_plotScatter(MRSCont,model,quant,metab,corrData,corrDataName)
% Creates correlation figure of  the chosen quantifcation and metabolite
% one figure contains a correlation analysis with subgroup correlations.
% If no groups are defined the distribution of the whole dataset will be shown. If no
% correlation measures are passed no correlation will be plotted.
%
%   USAGE:
%       [out_scat] = osp_plotScatter(MRSCont,which,metab,corrData,corrDataName,tit,GUI)
%
%   OUTPUTS:
%       [out_scat] = MATLAB figure handle
%
%   OUTPUTS:
%       MRSCont  = Osprey data container.
%       model    = Fitting Style
%       quant    = Quantification
%                   OPTIONS:    'tCr' (default)
%                               'rawWaterScaled'
%       quant    = Quantification
%       corrData = Data for correlation analysis
%
%   AUTHOR:
%       Helge Zoellner (Johns Hopkins University, 2019-11-14)
%       hzoelln2@jhmi.edu
%
%   CREDITS:
%       This code is uses a modified version of the regression_line_ci
%       package to plot confidence intervals
%       Boris Gutman
%       https://de.mathworks.com/matlabcentral/fileexchange/39339-linear-regression-confidence-interval
%       The colorbrewer package is included for nicer colors

    
function [out_scat] = osp_plotScatter(MRSCont,model,quant,metab,corrData,corrDataName,VoxelIndex,basis)
%% [out_scat] = osp_plotScatter(MRSCont,model,quant,metab,corrData,corrDataName)
% Creates correlation figure of  the chosen quantifcation and metabolite
% one figure contains a correlation analysis with subgroup correlations.
% If no groups are defined the distribution of the whole dataset will be shown. If no
% correlation measures are passed no correlation will be plotted.
%
%   USAGE:
%       [out_scat] = osp_plotScatter(MRSCont,which,metab,corrData,corrDataName,tit,GUI)
%
%   OUTPUTS:
%       [out_scat] = MATLAB figure handle
%
%   OUTPUTS:
%       MRSCont  = Osprey data container.
%       model    = Fitting Style
%       quant    = Quantification
%                   OPTIONS:    'tCr' (default)
%                               'rawWaterScaled'
%       quant    = Quantification
%       corrData = Data for correlation analysis
%
%   AUTHOR:
%       Helge Zoellner (Johns Hopkins University, 2019-11-14)
%       hzoelln2@jhmi.edu
%
%   CREDITS:
%       This code is uses a modified version of the regression_line_ci
%       package to plot confidence intervals
%       Boris Gutman
%       https://de.mathworks.com/matlabcentral/fileexchange/39339-linear-regression-confidence-interval
%       The colorbrewer package is included for nicer colors
%       Charles
%       https://de.mathworks.com/matlabcentral/fileexchange/34087-cbrewer-colorbrewer-schemes-for-matlab
%
%   HISTORY:
%       2019-11-12: First version of the code.
%%% 1. PARSE INPUT ARGUMENTS %%%
% Fall back to defaults if not provided
if nargin<8
    basis = 1;
    if nargin<7
        VoxelIndex = 1;
        if nargin<6
            corrDataName = 'correlation measure';
            if nargin<4
                error('No correlation data passed. Please add correlation data to the MRSCont.');
                if nargin<3
                    metab = 'GABA';
                    if nargin<2
                        which = 'tCr';
                        if nargin<1
                            error('ERROR: no input Osprey container specified.  Aborting!!');
                        end