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: runOptScenario.m
    path of file: ./repos/CADET/src/cadet-mi/examples/publications/LewekeEtAl2018/procopt
    
    the code of the file until where you have to start completion: function [gradientShape, overlaps, optResult] = runOptScenario(isSum, initShape, absMode, elutionConstraint, colLength, algorithm, saveToFile, idxSample)

    
function [gradientShape, overlaps, optResult] = runOptScenario(isSum, initShape, absMode, elutionConstraint, colLength, algorithm, saveToFile, idxSample)
%RUNOPTSCENARIO Runs a process optimization with various options
%  
%   See the functions BILINEARGRADIENTPROCESSOVERLAPMAX and
%   BILINEARGRADIENTPROCESSOVERLAPSUM for details on the 
%   parameters and the underlying optimization scenario.
%
%   RUNOPTSCENARIO(ISSUM, INITSHAPE) runs an optimization scenario where
%   ISSUM determines whether the sum of the peak overlaps is optimized or
%   their maximum. The initial shape of the bilinear gradient is given in
%   the vector INITSHAPE that determines the start concentration, slope,
%   and length of the first gradient.
%
%   RUNOPTSCENARIO(..., ABSMODE) uses ABSMODE to choose the type of (soft)
%   abs() function that is used on the product of two concentrations.
%   Defaults to 0 (no abs() used at all).
%
%   RUNOPTSCENARIO(..., ABSMODE, ELUTIONCONSTRAINT) additionally sets the constraint
%   type that enforces complete elution. If ELUTIONCONSTRAINT = 1, the concentration
%   at the end