Home > Mateda2.0 > ScriptsMateda > OptimizationScripts > DefaultEDA_TrapFunction.m

# DefaultEDA_TrapFunction

## PURPOSE

EXAMPLE 11:

## SYNOPSIS

This is a script file.

## DESCRIPTION

     EXAMPLE 11:
     Default EDA for the solution of the evalfuncntrap function
     The algorithm stops after a max number of generations is reached

## CROSS-REFERENCE INFORMATION

This function calls:

- RunEDA [AllStat,Cache]=RunEDA(PopSize,n,F,Card,cache,edaparams)

This function is called by:

## SOURCE CODE

    0001 % EXAMPLE 11:
    0002  % Default EDA for the solution of the evalfuncntrap function
    0003  % The algorithm stops after a max number of generations is reached
    0004
    0005   PopSize = 1000; n = 45; cache  = [0,0,0,0,0]; Card = 2*ones(1,n); edaparams = {};
    0006   F = 'evalfunctrapn'; % Trap function of parameter k=5;
    0007   global ntrapparam;
    0008   ntrapparam = 5;           % The parameter of the function is passed as a global variable
    0009
    0010   [AllStat,Cache]=RunEDA(PopSize,n,F,Card,cache,edaparams)