Code covered by the BSD License  

Highlights from
Desenvolvimento de Aplicacoes com MATLAB

image thumbnail

Desenvolvimento de Aplicacoes com MATLAB

by

 

Slides and demo files from the webinar "Desenvolvimento de Aplicacoes com MATLAB"

celltowersetup(param)
function  [R,xL,xU,yL,yU,lb,ub,x0] = celltowersetup(param)
    % CELLTOWERSETUP creates a randomly generated celltower problem.
    % param.towers
    % param.side
    % param.seed

    % Copyright 2003 The MathWorks, Inc.

    low = 0;
    rand('seed', param.seed);
    R = rand(param.towers, 1)+1; % allocate array

    % Generate bound constraints
    xL = low; xU = param.side;
    yL = low; yU = param.side;
    % 2*N variables in the order [x1,y1,x2,y2...,xn,yn]'
    lb = zeros(2*param.towers,1);
    ub = lb;
    lb(1:2:2*param.towers) = xL + R;
    lb(2:2:2*param.towers) = yL + R;
    ub(1:2:2*param.towers) = xU - R;
    ub(2:2:2*param.towers) = yU - R;

    % Random start point
    x0 = param.side * rand(2*param.towers,1);

end

Contact us