Code covered by the BSD License  

Highlights from
Web Server Demo

Web Server Demo

by

 

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

optim_towers_gui(varargin)
function varargout = optim_towers_gui(varargin)
% OPTIM_TOWERS_GUI MATLAB code for optim_towers_gui.fig
%      OPTIM_TOWERS_GUI, by itself, creates a new OPTIM_TOWERS_GUI or raises the existing
%      singleton*.
%
%      H = OPTIM_TOWERS_GUI returns the handle to a new OPTIM_TOWERS_GUI or the handle to
%      the existing singleton*.
%
%      OPTIM_TOWERS_GUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in OPTIM_TOWERS_GUI.M with the given input arguments.
%
%      OPTIM_TOWERS_GUI('Property','Value',...) creates a new OPTIM_TOWERS_GUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before optim_towers_gui_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to optim_towers_gui_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help optim_towers_gui

% Last Modified by GUIDE v2.5 14-Feb-2011 13:56:03

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @optim_towers_gui_OpeningFcn, ...
                   'gui_OutputFcn',  @optim_towers_gui_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before optim_towers_gui is made visible.
function optim_towers_gui_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to optim_towers_gui (see VARARGIN)

% Choose default command line output for optim_towers_gui
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes optim_towers_gui wait for user response (see UIRESUME)
% uiwait(handles.figure1);
towers = fix(str2double(get(handles.towers, 'string')));
side = fix(str2double(get(handles.side, 'string')));
[R, xL, xU, yL, yU, lb, ub, x0] = myCelltowersetup(towers,side);
myplotcircles(x0, 0, '', R, xL, xU, yL, yU);


% --- Outputs from this function are returned to the command line.
function varargout = optim_towers_gui_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in run.
function run_Callback(hObject, eventdata, handles)
% hObject    handle to run (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

set(hObject , 'enable', 'off');
set(handles.towers, 'enable', 'off');
set(handles.side  , 'enable', 'off');

% Get the constants from the RAM
lb=getappdata(0, 'optim_lbSaved');
ub=getappdata(0, 'optim_ubSaved');
x0=getappdata(0, 'optim_x0Saved');
R=getappdata(0, 'optim_RSaved');
xL=getappdata(0, 'optim_xLSaved');
xU=getappdata(0, 'optim_xUSaved');
yL=getappdata(0, 'optim_yLSaved');
yU=getappdata(0, 'optim_yUSaved');

[x,fval,exitflag,output] = myOptim(x0,lb,ub);
plotOptimSummary(output,R,xL,xU,yL,yU);

h2 = findobj('type', 'figure', 'tag', 'figure1');
set(0   , 'currentfigure', h2);
myplotcircles(x, 0, '', R, xL, xU, yL, yU);

set(hObject , 'enable', 'on');
set(handles.towers, 'enable', 'on');
set(handles.side  , 'enable', 'on');

% --- Executes on button press in pause.
function pause_Callback(hObject, eventdata, handles)
% hObject    handle to pause (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)



function towers_Callback(hObject, eventdata, handles)
% hObject    handle to towers (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of towers as text
%        str2double(get(hObject,'String')) returns contents of towers as a double
towers = fix(str2double(get(handles.towers, 'string')));
side = fix(str2double(get(handles.side, 'string')));
[R, xL, xU, yL, yU, lb, ub, x0] = myCelltowersetup(towers,side);
myplotcircles(x0, 0, '', R, xL, xU, yL, yU);

% --- Executes during object creation, after setting all properties.
function towers_CreateFcn(hObject, eventdata, handles)
% hObject    handle to towers (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function side_Callback(hObject, eventdata, handles)
% hObject    handle to side (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of side as text
%        str2double(get(hObject,'String')) returns contents of side as a double
towers = fix(str2double(get(handles.towers, 'string')));
side = fix(str2double(get(handles.side, 'string')));
[R, xL, xU, yL, yU, lb, ub, x0] = myCelltowersetup(towers,side);
myplotcircles(x0, 0, '', R, xL, xU, yL, yU);

% --- Executes during object creation, after setting all properties.
function side_CreateFcn(hObject, eventdata, handles)
% hObject    handle to side (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

Contact us