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: generateLUT.m
    path of file: ./repos/bspm/thirdparty/bramila/external/ISC_toolbox/ISCanalysis
    
    the code of the file until where you have to start completion: function generateLUT(Params,nrSession,winOn)

% This function generates look-up tables (LUTs)
% based on null distribution.
% 

    
function generateLUT(Params,nrSession,winOn)

% This function generates look-up tables (LUTs)
% based on null distribution.
% 
% inputs:
% Params - struct containing all necessary parameters
% nrSession - session index
% winOn - perform calculations for windowed (winOn=1) or across-session data (winOn=0)
%
% See also:
%
% COMBINENULLVALS
% CALCULATETHRESHOLDS
% EVALUATEPVALS
% INITPARAMS
% RUNANALYSIS
%
% last modified 10.11.2010
% Jukka-Pekka Kauppi
% Tampere University of Technology

Pub = Params.PublicParams;
Priv = Params.PrivateParams;
q = Priv.q;
intVals = Priv.intVals;
acc = Priv.acc;

% load LUT general parameters:
if winOn
  load([Priv.statsDestination Priv.prefixLUT 'generalwin' Priv.prefixSession num2str(nrSession)])
else
  load([Priv.statsDestination Priv.prefixLUT 'general' Priv.prefixSession num2str(nrSession)])
end
% load the most important part (>=q) of the null distribution:
if winOn
  load([Priv.statsDestination 'permTestValswin' Priv.prefixSession num2str(nrSession)])
else
  load([Priv.statsDestination 'permTestVals' Priv.prefixSession num2str(nrSession)])
end
plotFigs = 0; % plot figures (on/off)

% get decimation factors for each LUT. Accuracy for each LUT can be changed
% by modifying "acc" field in PrivateParams -struct.
acc = floor(N*diff(intVals)./acc);
acc(acc<1)=1;

% set maximal accuracy:
acc(acc>=1)=1;

% find critical value according to:
% Nichols and Holmes: "Nonparametric Permutation Tests For 
% Functional Neuroimaging: A Primer with Examples", HBM 15, 2001.
critVal = nullVals(1+floor(N*q));
critValFis = nullValsFis(1+floor(NFis*q));

if ~winOn && Pub.calcPhase
    critValPh = nullValsPh(1+floor(NPh*q));
end