function varargout = untitled(varargin)
% UNTITLED MATLAB code for untitled.fig
%      UNTITLED, by itself, creates a new UNTITLED or raises the existing
%      singleton*.
%
%      H = UNTITLED returns the handle to a new UNTITLED or the handle to
%      the existing singleton*.
%
%      UNTITLED('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in UNTITLED.M with the given input arguments.
%
%      UNTITLED('Property','Value',...) creates a new UNTITLED or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before untitled_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to untitled_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 untitled

% Last Modified by GUIDE v2.5 25-May-2018 23:18:29

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @untitled_OpeningFcn, ...
                   'gui_OutputFcn',  @untitled_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 untitled is made visible.
function untitled_OpeningFcn(hObject, ~, 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 untitled (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes untitled wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = untitled_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 pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
clc
syms c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
a=str2double(get(handles.edit1,'String'));
b=str2double(get(handles.edit3,'String'));
k=str2double(get(handles.edit2,'String'));
cw=str2double(get(handles.edit5,'String'));
ct0=str2double(get(handles.edit4,'String'));
c0m=zeros(11,1);
c1m=zeros(11,1);
c2m=zeros(11,1);
c3m=zeros(11,1);
c4m=zeros(11,1);
c5m=zeros(11,1);
c6m=zeros(11,1);
c7m=zeros(11,1);
c8m=zeros(11,1);
c9m=zeros(11,1);
c10m=zeros(11,1);
c0m(11,1)=ct0;
c1m(11,1)=ct0;
c2m(11,1)=ct0;
c3m(11,1)=ct0;
c4m(11,1)=ct0;
c5m(11,1)=ct0;
c6m(11,1)=ct0;
c7m(11,1)=ct0;
c8m(11,1)=ct0;
c9m(11,1)=ct0;
c10m(11,1)=ct0;
dc0_dt=a*((2*(c1-c0))/0.25);
dc1_dt=a*(((c2-2*c1+c0)/0.25)+((c2-c0)/0.5))-(b*k*c1*((4*pi*(0.5^3))/3));
dc2_dt=a*(((c3-2*c2+c1)/0.25)+((c3-c1)/(2*0.5)))-(b*k*c2*((4*pi*(1^3))/3));
dc3_dt=a*(((c4-2*c3+c2)/0.25)+((c4-c2)/(3*0.5)))-(b*k*c3*((4*pi*(1.5^3))/3));
dc4_dt=a*(((c5-2*c4+c3)/0.25)+((c5-c3)/(4*0.5)))-(b*k*c4*((4*pi*(2^3))/3));
dc5_dt=a*(((c6-2*c5+c4)/0.25)+((c6-c4)/(5*0.5)))-(b*k*c5*((4*pi*(2.5^3))/3));
dc6_dt=a*(((c7-2*c6+c5)/0.25)+((c7-c5)/(6*0.5)))-(b*k*c6*((4*pi*(3^3))/3));
dc7_dt=a*(((c8-2*c7+c6)/0.25)+((c8-c6)/(7*0.5)))-(b*k*c7*((4*pi*(3.5^3))/3));
dc8_dt=a*(((c9-2*c8+c7)/0.25)+((c9-c7)/(8*0.5)))-(b*k*c8*((4*pi*(4^3))/3));
dc9_dt=a*(((c10-2*c9+c8)/0.25)+((c10-c8)/(9*0.5)))-(b*k*c9*((4*pi*(4.5^3))/3));
dc10_dt=a*(((2*c9-b*c9-2*c10)/0.25)-((b*(cw-c10))/(10*0.5)))-(b*k*c10*((4*pi*(5^3))/3));
ode_solver=get(handles.popupmenu1,'Value');
switch ode_solver
case 2
    for i=10:-1:1
    c0m(i)=c0m(i+1)+0.5*(subs(dc0_dt,[c0 c1],[c0m(i+1) c1m(i+1)]));
    c1m(i)=c1m(i+1)+0.5*subs(dc1_dt,[c0 c1 c2],[c0m(i+1) c1m(i+1) c2m(i+1)]);
    c2m(i)=c2m(i+1)+0.5*subs(dc2_dt,[c1 c2 c3],[c1m(i+1) c2m(i+1) c3m(i+1)]);
    c3m(i)=c3m(i+1)+0.5*subs(dc3_dt,[c2 c3 c4],[c2m(i+1) c3m(i+1) c4m(i+1)]);
    c4m(i)=c4m(i+1)+0.5*subs(dc4_dt,[c3 c4 c5],[c3m(i+1) c4m(i+1) c5m(i+1)]);
    c5m(i)=c5m(i+1)+0.5*subs(dc5_dt,[c4 c5 c6],[c4m(i+1) c5m(i+1) c6m(i+1)]);
    c6m(i)=c6m(i+1)+0.5*subs(dc6_dt,[c5 c6 c7],[c5m(i+1) c6m(i+1) c7m(i+1)]);
    c7m(i)=c7m(i+1)+0.5*subs(dc7_dt,[c6 c7 c8],[c6m(i+1) c7m(i+1) c8m(i+1)]);
    c8m(i)=c8m(i+1)+0.5*subs(dc8_dt,[c7 c8 c9],[c7m(i+1) c8m(i+1) c9m(i+1)]);
    c9m(i)=c9m(i+1)+0.5*subs(dc9_dt,[c8 c9 c10],[c8m(i+1) c9m(i+1) c10m(i+1)]);
    c10m(i)=c9m(i+1)+0.5*subs(dc10_dt,[c9 c10],[c9m(i+1) c10m(i+1)]);
    end
    case 3
         for i=10:-1:1
    % mohasbh k1
    c01=subs(dc0_dt,[c0 c1],[c0m(i+1) c1m(i+1)]);
    c11=subs(dc1_dt,[c0 c1 c2],[c0m(i+1) c1m(i+1) c2m(i+1)]);
    c21=subs(dc2_dt,[c1 c2 c3],[c1m(i+1) c2m(i+1) c3m(i+1)]);
    c31=subs(dc3_dt,[c2 c3 c4],[c2m(i+1) c3m(i+1) c4m(i+1)]);
    c41=subs(dc4_dt,[c3 c4 c5],[c3m(i+1) c4m(i+1) c5m(i+1)]);
    c51=subs(dc5_dt,[c4 c5 c6],[c4m(i+1) c5m(i+1) c6m(i+1)]);
    c61=subs(dc6_dt,[c5 c6 c7],[c5m(i+1) c6m(i+1) c7m(i+1)]);
    c71=subs(dc7_dt,[c6 c7 c8],[c6m(i+1) c7m(i+1) c8m(i+1)]);
    c81=subs(dc8_dt,[c7 c8 c9],[c7m(i+1) c8m(i+1) c9m(i+1)]);
    c91=subs(dc9_dt,[c8 c9 c10],[c8m(i+1) c9m(i+1) c10m(i+1)]);
    c101=subs(dc10_dt,[c9 c10],[c9m(i+1) c10m(i+1)]);
    % mohasbh k2
    c02=subs(dc0_dt,[c0 c1],[((0.5*c01)+c0m(i+1)) ((0.5*c11)+c1m(i+1))]);
    c12=subs(dc1_dt,[c0 c1 c2],[((0.5*c01)+c0m(i+1)) ((0.5*c11)+c1m(i+1)) ((0.5*c21)+c2m(i+1))]);
    c22=subs(dc2_dt,[c1 c2 c3],[((0.5*c11)+c1m(i+1)) ((0.5*c21)+c2m(i+1)) ((0.5*c31)+c3m(i+1))]);
    c32=subs(dc3_dt,[c2 c3 c4],[((0.5*c21)+c2m(i+1)) ((0.5*c31)+c3m(i+1)) ((0.5*c41)+c4m(i+1))]);
    c42=subs(dc4_dt,[c3 c4 c5],[((0.5*c31)+c3m(i+1)) ((0.5*c41)+c4m(i+1)) ((0.5*c51)+c5m(i+1))]);
    c52=subs(dc5_dt,[c4 c5 c6],[((0.5*c41)+c4m(i+1)) ((0.5*c51)+c5m(i+1)) ((0.5*c61)+c6m(i+1))]);
    c62=subs(dc6_dt,[c5 c6 c7],[((0.5*c51)+c5m(i+1)) ((0.5*c61)+c6m(i+1)) ((0.5*c71)+c7m(i+1))]);
    c72=subs(dc7_dt,[c6 c7 c8],[((0.5*c61)+c6m(i+1)) ((0.5*c71)+c7m(i+1)) ((0.5*c81)+c8m(i+1))]);
    c82=subs(dc8_dt,[c7 c8 c9],[((0.5*c71)+c7m(i+1)) ((0.5*c81)+c8m(i+1)) ((0.5*c91)+c9m(i+1))]);
    c92=subs(dc9_dt,[c8 c9 c10],[((0.5*c81)+c8m(i+1)) ((0.5*c91)+c9m(i+1)) ((0.5*c101)+c10m(i+1))]);
    c102=subs(dc10_dt,[c9 c10],[((0.5*c91)+c9m(i+1)) ((0.5*c101)+c10m(i+1))]);
    %solve
    c0m(i)=c0m(i+1)+(0.5/2)*(c01+c02);
    c1m(i)=c1m(i+1)+(0.5/2)*(c11+c12);
    c2m(i)=c2m(i+1)+(0.5/2)*(c21+c22);
    c3m(i)=c3m(i+1)+(0.5/2)*(c31+c32);
    c4m(i)=c4m(i+1)+(0.5/2)*(c41+c42);
    c5m(i)=c5m(i+1)+(0.5/2)*(c51+c52);
    c6m(i)=c6m(i+1)+(0.5/2)*(c61+c62);
    c7m(i)=c7m(i+1)+(0.5/2)*(c71+c72);
    c8m(i)=c8m(i+1)+(0.5/2)*(c81+c82);
    c9m(i)=c9m(i+1)+(0.5/2)*(c91+c92);
    c10m(i)=c10m(i+1)+(0.5/2)*(c101+c102);
    end
case 4
        for i=10:-1:1
    % mohasbh k1
    c01=subs(dc0_dt,[c0 c1],[c0m(i+1) c1m(i+1)]);
    c11=subs(dc1_dt,[c0 c1 c2],[c0m(i+1) c1m(i+1) c2m(i+1)]);
    c21=subs(dc2_dt,[c1 c2 c3],[c1m(i+1) c2m(i+1) c3m(i+1)]);
    c31=subs(dc3_dt,[c2 c3 c4],[c2m(i+1) c3m(i+1) c4m(i+1)]);
    c41=subs(dc4_dt,[c3 c4 c5],[c3m(i+1) c4m(i+1) c5m(i+1)]);
    c51=subs(dc5_dt,[c4 c5 c6],[c4m(i+1) c5m(i+1) c6m(i+1)]);
    c61=subs(dc6_dt,[c5 c6 c7],[c5m(i+1) c6m(i+1) c7m(i+1)]);
    c71=subs(dc7_dt,[c6 c7 c8],[c6m(i+1) c7m(i+1) c8m(i+1)]);
    c81=subs(dc8_dt,[c7 c8 c9],[c7m(i+1) c8m(i+1) c9m(i+1)]);
    c91=subs(dc9_dt,[c8 c9 c10],[c8m(i+1) c9m(i+1) c10m(i+1)]);
    c101=subs(dc10_dt,[c9 c10],[c9m(i+1) c10m(i+1)]);
    % mohasbh k2
    c02=subs(dc0_dt,[c0 c1],[((0.25*c01)+c0m(i+1)) ((0.25*c11)+c1m(i+1))]);
    c12=subs(dc1_dt,[c0 c1 c2],[((0.25*c01)+c0m(i+1)) ((0.25*c11)+c1m(i+1)) ((0.25*c21)+c2m(i+1))]);
    c22=subs(dc2_dt,[c1 c2 c3],[((0.25*c11)+c1m(i+1)) ((0.25*c21)+c2m(i+1)) ((0.25*c31)+c3m(i+1))]);
    c32=subs(dc3_dt,[c2 c3 c4],[((0.25*c21)+c2m(i+1)) ((0.25*c31)+c3m(i+1)) ((0.25*c41)+c4m(i+1))]);
    c42=subs(dc4_dt,[c3 c4 c5],[((0.25*c31)+c3m(i+1)) ((0.25*c41)+c4m(i+1)) ((0.25*c51)+c5m(i+1))]);
    c52=subs(dc5_dt,[c4 c5 c6],[((0.25*c41)+c4m(i+1)) ((0.25*c51)+c5m(i+1)) ((0.25*c61)+c6m(i+1))]);
    c62=subs(dc6_dt,[c5 c6 c7],[((0.25*c51)+c5m(i+1)) ((0.25*c61)+c6m(i+1)) ((0.25*c71)+c7m(i+1))]);
    c72=subs(dc7_dt,[c6 c7 c8],[((0.25*c61)+c6m(i+1)) ((0.25*c71)+c7m(i+1)) ((0.25*c81)+c8m(i+1))]);
    c82=subs(dc8_dt,[c7 c8 c9],[((0.25*c71)+c7m(i+1)) ((0.25*c81)+c8m(i+1)) ((0.25*c91)+c9m(i+1))]);
    c92=subs(dc9_dt,[c8 c9 c10],[((0.25*c81)+c8m(i+1)) ((0.25*c91)+c9m(i+1)) ((0.25*c101)+c10m(i+1))]);
    c102=subs(dc10_dt,[c9 c10],[((0.25*c91)+c9m(i+1)) ((0.25*c101)+c10m(i+1))]);
    % mohasbh k3
    c03=subs(dc0_dt,[c0 c1],[((0.25*c02)+c0m(i+1)) ((0.25*c12)+c1m(i+1))]);
    c13=subs(dc1_dt,[c0 c1 c2],[((0.25*c02)+c0m(i+1)) ((0.25*c12)+c1m(i+1)) ((0.25*c22)+c2m(i+1))]);
    c23=subs(dc2_dt,[c1 c2 c3],[((0.25*c12)+c1m(i+1)) ((0.25*c22)+c2m(i+1)) ((0.25*c32)+c3m(i+1))]);
    c33=subs(dc3_dt,[c2 c3 c4],[((0.25*c22)+c2m(i+1)) ((0.25*c32)+c3m(i+1)) ((0.25*c42)+c4m(i+1))]);
    c43=subs(dc4_dt,[c3 c4 c5],[((0.25*c32)+c3m(i+1)) ((0.25*c42)+c4m(i+1)) ((0.25*c52)+c5m(i+1))]);
    c53=subs(dc5_dt,[c4 c5 c6],[((0.25*c42)+c4m(i+1)) ((0.25*c52)+c5m(i+1)) ((0.25*c62)+c6m(i+1))]);
    c63=subs(dc6_dt,[c5 c6 c7],[((0.25*c52)+c5m(i+1)) ((0.25*c62)+c6m(i+1)) ((0.25*c72)+c7m(i+1))]);
    c73=subs(dc7_dt,[c6 c7 c8],[((0.25*c62)+c6m(i+1)) ((0.25*c72)+c7m(i+1)) ((0.25*c82)+c8m(i+1))]);
    c83=subs(dc8_dt,[c7 c8 c9],[((0.25*c72)+c7m(i+1)) ((0.25*c82)+c8m(i+1)) ((0.25*c92)+c9m(i+1))]);
    c93=subs(dc9_dt,[c8 c9 c10],[((0.25*c82)+c8m(i+1)) ((0.25*c92)+c9m(i+1)) ((0.25*c102)+c10m(i+1))]);
    c103=subs(dc10_dt,[c9 c10],[((0.25*c92)+c9m(i+1)) ((0.25*c102)+c10m(i+1))]);
    % mohasbh k4
    c04=subs(dc0_dt,[c0 c1],[((0.5*c03)+c0m(i+1)) ((0.5*c13)+c1m(i+1))]);
    c14=subs(dc1_dt,[c0 c1 c2],[((0.5*c03)+c0m(i+1)) ((0.5*c13)+c1m(i+1)) ((0.5*c23)+c2m(i+1))]);
    c24=subs(dc2_dt,[c1 c2 c3],[((0.5*c13)+c1m(i+1)) ((0.5*c23)+c2m(i+1)) ((0.5*c33)+c3m(i+1))]);
    c34=subs(dc3_dt,[c2 c3 c4],[((0.5*c23)+c2m(i+1)) ((0.5*c33)+c3m(i+1)) ((0.5*c43)+c4m(i+1))]);
    c44=subs(dc4_dt,[c3 c4 c5],[((0.5*c33)+c3m(i+1)) ((0.5*c43)+c4m(i+1)) ((0.5*c53)+c5m(i+1))]);
    c54=subs(dc5_dt,[c4 c5 c6],[((0.5*c43)+c4m(i+1)) ((0.5*c53)+c5m(i+1)) ((0.5*c63)+c6m(i+1))]);
    c64=subs(dc6_dt,[c5 c6 c7],[((0.5*c53)+c5m(i+1)) ((0.5*c63)+c6m(i+1)) ((0.5*c73)+c7m(i+1))]);
    c74=subs(dc7_dt,[c6 c7 c8],[((0.5*c63)+c6m(i+1)) ((0.5*c73)+c7m(i+1)) ((0.5*c83)+c8m(i+1))]);
    c84=subs(dc8_dt,[c7 c8 c9],[((0.5*c73)+c7m(i+1)) ((0.5*c83)+c8m(i+1)) ((0.5*c93)+c9m(i+1))]);
    c94=subs(dc9_dt,[c8 c9 c10],[((0.5*c83)+c8m(i+1)) ((0.5*c93)+c9m(i+1)) ((0.5*c103)+c10m(i+1))]);
    c104=subs(dc10_dt,[c9 c10],[((0.5*c93)+c9m(i+1)) ((0.5*c103)+c10m(i+1))]);
    % solve
    c0m(i)=c0m(i+1)+(0.5/6)*(c01+(2*c02)+(2*c03)+c04);
    c1m(i)=c1m(i+1)+(0.5/6)*(c11+(2*c12)+(2*c13)+c14);
    c2m(i)=c2m(i+1)+(0.5/6)*(c21+(2*c22)+(2*c23)+c24);
    c3m(i)=c3m(i+1)+(0.5/6)*(c31+(2*c32)+(2*c33)+c34);
    c4m(i)=c4m(i+1)+(0.5/6)*(c41+(2*c42)+(2*c43)+c44);
    c5m(i)=c5m(i+1)+(0.5/6)*(c51+(2*c52)+(2*c53)+c54);
    c6m(i)=c6m(i+1)+(0.5/6)*(c61+(2*c62)+(2*c63)+c64);
    c7m(i)=c7m(i+1)+(0.5/6)*(c71+(2*c72)+(2*c73)+c74);
    c8m(i)=c8m(i+1)+(0.5/6)*(c81+(2*c82)+(2*c83)+c84);
    c9m(i)=c9m(i+1)+(0.5/6)*(c91+(2*c92)+(2*c93)+c94);
    c10m(i)=c10m(i+1)+(0.5/6)*(c101+(2*c102)+(2*c103)+c104);
    end
end
 C=[c0m c1m c2m c3m c4m c5m c6m c7m c8m c9m c10m];
 set(handles.uitable1,'Data',C)
 disp(C)
 surf(C)
 figure
 R=[0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5];
 c0p=C(11,:);
 c1p=C(10,:);
 c2p=C(9,:);
 c3p=C(8,:);
 c4p=C(7,:);
 c5p=C(6,:);
 c6p=C(5,:);
 c7p=C(4,:);
 c8p=C(3,:);
 c9p=C(2,:);
 c10p=C(1,:);
 plot(R,c0p,R,c1p,R,c2p,R,c3p,R,c4p,R,c5p,R,c6p,R,c7p,R,c8p,R,c9p,R,c10p)
 xlabel('R(cm)')
 ylabel('C(mol/cm3)')
 
 
 
     


function edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (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 edit1 as text
%        str2double(get(hObject,'String')) returns contents of edit1 as a double


% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit1 (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 edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (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 edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double


% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (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 edit3_Callback(hObject, eventdata, handles)
% hObject    handle to edit3 (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 edit3 as text
%        str2double(get(hObject,'String')) returns contents of edit3 as a double


% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit3 (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 edit4_Callback(hObject, eventdata, handles)
% hObject    handle to edit4 (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 edit4 as text
%        str2double(get(hObject,'String')) returns contents of edit4 as a double


% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit4 (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 edit5_Callback(hObject, eventdata, handles)
% hObject    handle to edit5 (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 edit5 as text
%        str2double(get(hObject,'String')) returns contents of edit5 as a double


% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit5 (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


% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu1


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

% Hint: popupmenu 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
