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: l1Scan2.m
    path of file: ./repos/d2d/arFramework3/Examples/Dream6_L1
    
    the code of the file until where you have to start completion: % L1 scan
% jks       relative parameters to be investigated by L1 regularization
% linv      width, i.e. i
    
function l1Scan2(jks, linv, gradient)

global ar

if(isempty(ar))
    error('please initialize by arInit')
end

if(~exist('jks','var') || isempty(jks))
    jks = find(ar.type == 3);
    if(isempty(jks))
        error('please initialize by l1Init')
    end