% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

LIC = license('inuse');
for elem = 1:numel(LIC)
    envStr = lower(LIC(elem).feature);
    if any(strcmp(envStr,{'matlab','octave'}))
        switch envStr
            case 'matlab'
                clear LIC elem
                modelConstantsNames = who;
            case 'octave'
                clear LIC elem
                modelConstantsNames = who -variables;
                keepThese=[];
                for j=1:numel(modelConstantsNames)
                    if ~(length(modelConstantsNames{j})>=2 &&...
                            strcmp(modelConstantsNames{j}(1:2),'__'))
                        keepThese = [keepThese;j];                       
                    end
                end
                clear j
                modelConstantsNames = modelConstantsNames(keepThese,1)
                clear toBeCleared
        end
        break
    end
end

mConstants = modelConstantsNames;

for k=1:numel(modelConstantsNames)
    eval(['mConstants{k,2}=',modelConstantsNames{k,1},';'])
end

clear modelConstantsNames k