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: get_pre_proc.m
    path of file: ./repos/multi_objective_optimization_matlab/src/optim
    
    the code of the file until where you have to start completion: function [optim, n_var, n_init] = get_pre_proc(var_param)
%GET_PRE_PROC Parse and scale the input variables, generates the initial points.
%   [optim, n_var, n_init] = GET_PRE_PROC(var_param)
%   var_param - struct with the variable description (struct)
%      data.n_max - maximum number of initial points for avoid out of memory crashes (integer)
%      data.fct_select - check if the generated iniitial points should be included (function handle)
%         idx = fct_select(input, n_size)
%         input - parsed and scaled input points (struct of arrays)
%         n_size - number of points (integer)
%         idx - indices to be selected (array of indices or array of logical)
%      data.var - cell of struct with the different variable description (cell of struct)
%          data.var{i}.type - type of the variable (string containing 'lin_float')
%          data.var{i}.name - name of the variable (string)
%          data.var{i} - description of a float variable with linear scale (type is 'float')
%              data.var{i}.scale - scaling of the variable (string)
%                  'lin' - no scaling is performed
%                  'log' - log10(x) scaling of the variable
%                  'exp' - 10^x scaling of the variable
%                  'square' - x^2 scaling of the variable
%                  'sqrt' - sqrt(x) scaling of the variable
%              data.var{i}.lb - lower boundary for the variable (float)
%              data.var{i}.ub - upper boundary for the variable (float)
%              data.var{i}.vec - vector with the values for the initial points (vector of floats)
%          data.var{i} - description of an integer variable (type is 'integer')
%              data.var{i}.set - integer with the set of possible values (array of integer)
%              data.var{i}.vec - integer with the initial combinations (array of integer)
%          data.var{i} - description of a constant (non-optimized) variable (type is 'scalar')
%              data.var{i}.v - value of the single constant variable (float)
%   optim - struct with the parsed variables (struct)
%      optim.lb - array containing the lower bounds of the variables (array)
%      optim.ub - array containing the upper bounds of the variables (array)
%      optim.int_con - array containing the index of the integer variables (array of indices)
%      optim.input - struct containing the constant (non-optimized) variables (struct of scalars)
%      optim.x0 - matrix containing the scaled initial points (matrix)
%      optim.fct_input - function creating the input struct from the scaled variables (function handle)
%         [input, n_size] = fct_input(x)
%         x - input points to be evaluated (matrix)
%         input - parsed and scaled input points (struct of arrays)
%         n_size - number of points (integer)
%   n_var - number of input variables used for the optimization (integer)
%   n_init - number of initial points used by the algorithm (integer)

    
function [optim, n_var, n_init] = get_pre_proc(var_param)
%GET_PRE_PROC Parse and scale the input variables, generates the initial points.
%   [optim, n_var, n_init] = GET_PRE_PROC(var_param)
%   var_param - struct with the variable description (struct)
%      data.n_max - maximum number of initial points for avoid out of memory crashes (integer)
%      data.fct_select - check if the generated iniitial points should be included (function handle)
%         idx = fct_select(input, n_size)
%         input - parsed and scaled input points (struct of arrays)
%         n_size - number of points (integer)
%         idx - indices to be selected (array of indices or array of logical)
%      data.var - cell of struct with the different variable description (cell of struct)
%          data.var{i}.type - type of the variable (string containing 'lin_float')
%          data.var{i}.name - name of the variable (string)
%          data.var{i} - description of a float variable with linear scale (type is 'float')
%              data.var{i}.scale - scaling of the variable (string)
%                  'lin' - no scaling is performed
%                  'log' - log10(x) scaling of the variable
%                  'exp' - 10^x scaling of the variable
%                  'square' - x^2 scaling of the variable
%                  'sqrt' - sqrt(x) scaling of the variable
%              data.var{i}.lb - lower boundary for the variable (float)
%              data.var{i}.ub - upper boundary for the variable (float)
%              data.var{i}.vec - vector with the values for the initial points (vector of floats)
%          data.var{i} - description of an integer variable (type is 'integer')
%              data.var{i}.set - integer with the set of possible values (array of integer)
%              data.var{i}.vec - integer with the initial combinations (array of integer)
%          data.var{i} - description of a constant (non-optimized) variable (type is 'scalar')
%              data.var{i}.v - value of the single constant variable (float)
%   optim - struct with the parsed variables (struct)
%      optim.lb - array containing the lower bounds of the variables (array)
%      optim.ub - array containing the upper bounds of the variables (array)
%      optim.int_con - array containing the index of the integer variables (array of indices)
%      optim.input - struct containing the constant (non-optimized) variables (struct of scalars)
%      optim.x0 - matrix containing the scaled initial points (matrix)
%      optim.fct_input - function creating the input struct from the scaled variables (function handle)
%         [input, n_size] = fct_input(x)
%         x - input points to be evaluated (matrix)
%         input - parsed and scaled input points (struct of arrays)
%         n_size - number of points (integer)
%   n_var - number of input variables used for the optimization (integer)
%   n_init - number of initial points used by the algorithm (integer)
%
%   This function performs the following tasks on the variables:
%      - Find the lower and upper bounds
%      - Find the integer variables
%      - Find the constant variables
%      - Spanning the initial points
%      - Filtering the valid initial points
%      - Scaling the variables:
%         - Scale the 'float' variables with 'lin', 'log', 'exp', 'square', or 'sqrt'
%         - Mapping integer variables from [x1, x1, ..., xn] to [1, 2, ..., n]
%
%   See also GET_MULTI_OBJ_OPT, GET_SOLUTION.
%
%   (c) 2019-2020, ETH Zurich, Power Electronic Systems Laboratory, T. Guillod

% extract the provided data
var = var_param.var;
n_max = var_param.n_max;
fct_select = var_param.fct_select;

% init the output
var_scale = {};
lb = [];
int_con = [];
ub = [];
x0_cell = {};
var_cst = struct();

% parse the different variable
for i=1:length(var)
    var_tmp = var{i};
    
    switch var_tmp.type
        case 'scalar'
            % scalar variable should not be array, assign them to the input struct
            assert(length(var_tmp.v)==1, 'invalid length')
            var_cst.(var_tmp.name) = var_tmp.v;
        case 'integer'
            % check that the initial points respect the set
            assert(length(var_tmp.set)>1, 'invalid length')
            assert(all(ismember(var_tmp.vec, var_tmp.set)), 'invalid initial vector')
            
            % get the scaling function
            [fct_scale, fct_unscale] = get_scale('integer');

            % mapping integer variables from [x1, x1, ..., xn] to [1, 2, ..., n]
            var_scale{end