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: SQI.m
    path of file: ./repos/fieldtrip/external/artinis/private
    
    the code of the file until where you have to start completion: function SQIscore = SQI(OD1,OD2,oxy,dxy,Fs)
%%% This function reads in fNIRS data and returns a scalar value representing
%%% the signal quality score.
%%%
%%% Use as SQIscore = SQI(OD1,OD2,oxy,dxy,Fs)
%%% where
%%%     OD1, OD2    -   1xN vectors containing optical density signals from 
%%%                     each wavelength. N is the number of samples. 
%%%     oxy         -   1xN vector containing O2Hb signal (concentration
%%%                     changes in oxygenated hemoglobin)
%%%     dxy         -   1xN vector containing HHb signal (concentration
%%%                     changes in deoxygenated hemoglobin)
%%%     Fs          -   scalar, sampling rate in Hz
%%%
%%%     SQIscore    -   scalar, signal quality score ranging from 1 (very 
%%%                     low quality) to 5 (very high quality)
%%%
%%% All input arguments are necessary.
%%%
%%% The performance of this function has been tested on 10-second interval 

    
function SQIscore = SQI(OD1,OD2,oxy,dxy,Fs)
%%% This function reads in fNIRS data and returns a scalar value representing
%%% the signal quality score.
%%%
%%% Use as SQIscore = SQI(OD1,OD2,oxy,dxy,Fs)
%%% where
%%%     OD1, OD2    -   1xN vectors containing optical density signals from 
%%%                     each wavelength. N is the number of samples. 
%%%     oxy         -   1xN vector containing O2Hb signal (concentration
%%%                     changes in oxygenated hemoglobin)
%%%     dxy         -   1xN vector containing HHb signal (concentration
%%%                     changes in deoxygenated hemoglobin)
%%%     Fs          -   scalar, sampling rate in Hz
%%%
%%%     SQIscore    -   scalar, signal quality score ranging from 1 (very 
%%%                     low quality) to 5 (very high quality)
%%%
%%% All input arguments are necessary.
%%%
%%% The performance of this function has been tested on 10-second interval 
%%% signal segments recorded with Artinis devices (OxyMon, OctaMon, Brite23, Brite24)
%%%
%%% This script makes use of the following functions:
%%% detrend