Code covered by the BSD License

Web Server Demo

Stefan Duprey (view profile)

How to deploy a MATLABĀ® made application on a web server

myCelltowersetup(N,up)
```function  [R,xL,xU,yL,yU,lb,ub,x0] = myCelltowersetup(N,up)
% CELLTOWERSETUP creates a randomly generated celltower problem.
%   [R,xL,xU,yL,yU,lb,ub,x0] = CELLTOWERSETUP(N, SIDE)
%
%   Input:
%           N    : number of towers
%           SIDE : length of the side of area
%   Output:
%           R    : radius of cell tower coverage
%           xL   : 0       % for plotting
%           xU   : SIDE    % for plotting
%           yL   : 0       % for plotting
%           yU   : SIDE    % for plotting
%           lb   : lower bound values for x, y (based on the radius)
%           ub   : upper bound values for x, y (based on the radius)
%           x0   : initial center points (x, y pairs)
%
% Copyright 2003 The MathWorks, Inc.

low = 0;
% just for initializing the random stream : to get the same result
% with the same paramater, not mandatory
s = RandStream('mt19937ar','seed',0);
RandStream.setDefaultStream(s);
R = rand(N,1)+1; % allocate array
setappdata(0, 'optim_RSaved', R);
% Generate bound constraints
xL = low; xU = up;
yL = low; yU = up;
setappdata(0, 'optim_xLSaved', xL);
setappdata(0, 'optim_xUSaved', xU);
setappdata(0, 'optim_yLSaved', yL);
setappdata(0, 'optim_yUSaved', yU);
% 2*N variables in the order [x1,y1,x2,y2...,xn,yn]'
lb = zeros(2*N,1);
ub = lb;
lb(1:2:2*N) = xL + R;
lb(2:2:2*N) = yL + R;
ub(1:2:2*N) = xU - R;
ub(2:2:2*N) = yU - R;
setappdata(0, 'optim_lbSaved', lb);
setappdata(0, 'optim_ubSaved', ub);

% Random start point
x0 = up*rand(2*N,1);
setappdata(0, 'optim_x0Saved', x0);
```