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

% Last Modified by GUIDE v2.5 03-May-2005 10:57:17

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @Window_3_OpeningFcn, ...
                   'gui_OutputFcn',  @Window_3_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin & isstr(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 Window_3 is made visible.
function Window_3_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 Window_3 (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

handles.prefs=varargin{1};

load('marker_data')
handles.markers=ds;


all_data=[];
for n=1:length(handles.prefs.filenames)
    load(strcat(handles.prefs.proj_dir,'param_data_',strrep(handles.prefs.filenames{n},'.wav','')))
    all_data=cat(2,all_data,data);
end

nan_det = isfinite(all_data);
[x y] = find(nan_det==0);
for n=1:size(x)
    all_data(x(n),:)=0;
end

all_data=cat(2,all_data,handles.markers.data);
all_data_choose=all_data.*repmat(handles.prefs.features',[1 size(all_data,2)]);
%size(all_data)
%size(repmat(handles.prefs.features',[1 size(all_data,2)]))
load(strcat(handles.prefs.proj_dir,'Class'));
handles.prefs.pca.class=call_class;
handles.all_data=all_data;
handles.all_data_choose=all_data_choose; guidata(hObject, handles);

[D, E, handles.z_scores]=pca(handles.all_data_choose); guidata(hObject, handles);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MEAN analysis
data_anal=handles.z_scores(1:size(handles.z_scores,1)-8,1:3);


data_mean=mean(data_anal,1);
dist_all=((data_anal(:,1)-data_mean(1)).^2 + (data_anal(:,2)-data_mean(2)).^2 + (data_anal(:,3)-data_mean(3)).^2).^0.5;
m_data_all=mean(dist_all)

for n=1:10
    f_d=find(call_class==n);
    if ~isempty(f_d)
        data_anal_call=data_anal(f_d,:);
        data_mean=mean(data_anal_call,1);
        dist=((data_anal_call(:,1)-data_mean(1)).^2 + (data_anal_call(:,2)-data_mean(2)).^2 + (data_anal_call(:,3)-data_mean(3)).^2).^0.5;
        m_data(n)=mean(dist);
    else
        m_data(n)=0;
    end
end
m_data=m_data/m_data_all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


handles.prefs.pca.mincallno=1;
handles.prefs.pca.maxcallno=size(handles.z_scores,1)-8;
handles.prefs.pca.comps=2;
handles.prefs.pca.man_axes=0;
handles.prefs.pca.use_calls=[1 0 1 1 1 1 1 1 1 1]; 
handles.prefs.pca.datapoints=1;
handles.prefs.pca.datanumbers=1; guidata(hObject, handles);

set(handles.r2d,'value',1);
set(handles.r3d,'value',0);
set(handles.man_axes,'value',0);
set(handles.A,'value',handles.prefs.pca.use_calls(3));
set(handles.B,'value',handles.prefs.pca.use_calls(4));
set(handles.C,'value',handles.prefs.pca.use_calls(5));
set(handles.D,'value',handles.prefs.pca.use_calls(6));
set(handles.E,'value',handles.prefs.pca.use_calls(7));
set(handles.F,'value',handles.prefs.pca.use_calls(8));
set(handles.G,'value',handles.prefs.pca.use_calls(9));
set(handles.H,'value',handles.prefs.pca.use_calls(10));
set(handles.other,'value',handles.prefs.pca.use_calls(1));
set(handles.null,'value',handles.prefs.pca.use_calls(2));
set(handles.datanumbers,'value',1);

% handles.prefs.pca.A=1;
% handles.prefs.pca.B=1;
% handles.prefs.pca.C=1;
% handles.prefs.pca.D=1;
% handles.prefs.pca.E=1;
% handles.prefs.pca.F=1;
% handles.prefs.pca.G=1;
% handles.prefs.pca.H=1;
% handles.prefs.pca.null=0;
% handles.prefs.pca.other=1;


set(handles.edit1,'string','1');
set(handles.edit2,'string',int2str(handles.prefs.pca.maxcallno));

handles.FIG = pca_win(handles.z_scores,handles.prefs,handles.markers); guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = Window_3_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 radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of radiobutton1
guidata(hObject, handles);



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

% Hint: get(hObject,'Value') returns toggle state of r2d


set(handles.r2d,'value',1);
set(handles.r3d,'value',0);
set(handles.man_axes,'value',0)
handles.prefs.pca.man_axes=0; guidata(hObject, handles);
handles.prefs.pca.comps=2; guidata(hObject, handles);
handles.FIG = pca_win(handles.z_scores,handles.prefs,handles.markers); guidata(hObject, handles);


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

% Hint: get(hObject,'Value') returns toggle state of r3d


set(handles.r2d,'value',0);
set(handles.r3d,'value',1);
set(handles.man_axes,'value',0)
handles.prefs.pca.man_axes=0; guidata(hObject, handles);
handles.prefs.pca.comps=3; guidata(hObject, handles);
handles.FIG = pca_win(handles.z_scores,handles.prefs,handles.markers); guidata(hObject, handles);


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

[filename, pathname] = uiputfile( ...
    {'*.txt';'*.*'}, ...
    'Save parameter Data');
data=handles.all_data;
save(strcat(pathname,filename),'data','-ascii');

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

[filename, pathname] = uiputfile( ...
    {'*.txt';'*.*'}, ...
    'Save PCA Data');
data=handles.z_scores;
save(strcat(pathname,filename),'data','-ascii');

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

handles.prefs.PCASt = 1;
guidata(hObject, handles);

close(handles.output)
close('PCA Plot')
main(handles.prefs)


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


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

% Hint: get(hObject,'Value') returns toggle state of A

if handles.prefs.pca.use_calls(3)==1
    set(handles.A,'value',0);
    handles.prefs.pca.use_calls(3)=0; guidata(hObject, handles);
else
    set(handles.A,'value',1);
    handles.prefs.pca.use_calls(3)=1; guidata(hObject, handles);
end 

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

% Hint: get(hObject,'Value') returns toggle state of B

if handles.prefs.pca.use_calls(4)==1
    set(handles.B,'value',0);
    handles.prefs.pca.use_calls(4)=0; guidata(hObject, handles);
else
    set(handles.B,'value',1);
    handles.prefs.pca.use_calls(4)=1; guidata(hObject, handles);
end

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

% Hint: get(hObject,'Value') returns toggle state of C

if handles.prefs.pca.use_calls(5)==1
    set(handles.C,'value',0);
    handles.prefs.pca.use_calls(5)=0; guidata(hObject, handles);
else
    set(handles.C,'value',1);
    handles.prefs.pca.use_calls(5)=1; guidata(hObject, handles);
end
% --- Executes on button press in D.
function D_Callback(hObject, eventdata, handles)
% hObject    handle to D (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of D

if handles.prefs.pca.use_calls(6)==1
    set(handles.D,'value',0);
    handles.prefs.pca.use_calls(6)=0; guidata(hObject, handles);
else
    set(handles.D,'value',1);
    handles.prefs.pca.use_calls(6)=1; guidata(hObject, handles);
end
% --- Executes on button press in E.
function E_Callback(hObject, eventdata, handles)
% hObject    handle to E (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of E

if handles.prefs.pca.use_calls(7)==1
    set(handles.E,'value',0);
    handles.prefs.pca.use_calls(7)=0; guidata(hObject, handles);
else
    set(handles.E,'value',1);
    handles.prefs.pca.use_calls(7)=1; guidata(hObject, handles);
end
% --- Executes on button press in F.
function F_Callback(hObject, eventdata, handles)
% hObject    handle to F (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of F

if handles.prefs.pca.use_calls(8)==1
    set(handles.F,'value',0);
    handles.prefs.pca.use_calls(8)=0; guidata(hObject, handles);
else
    set(handles.F,'value',1);
    handles.prefs.pca.use_calls(8)=1; guidata(hObject, handles);
end
% --- Executes on button press in G.
function G_Callback(hObject, eventdata, handles)
% hObject    handle to G (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of G

if handles.prefs.pca.use_calls(9)==1
    set(handles.G,'value',0);
    handles.prefs.pca.use_calls(9)=0; guidata(hObject, handles);
else
    set(handles.G,'value',1);
    handles.prefs.pca.use_calls(9)=1; guidata(hObject, handles);
end
% --- Executes on button press in H.
function H_Callback(hObject, eventdata, handles)
% hObject    handle to H (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of H
if handles.prefs.pca.use_calls(10)==1
    set(handles.H,'value',0);
    handles.prefs.pca.use_calls(10)=0; guidata(hObject, handles);
else
    set(handles.H,'value',1);
    handles.prefs.pca.use_calls(10)=1; guidata(hObject, handles);
end

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

% Hint: get(hObject,'Value') returns toggle state of null

if handles.prefs.pca.use_calls(2)==1
    set(handles.null,'value',0);
    handles.prefs.pca.use_calls(2)=0; guidata(hObject, handles);
else
    set(handles.null,'value',1);
    handles.prefs.pca.use_calls(2)=1; guidata(hObject, handles);
end
% --- Executes on button press in other.
function other_Callback(hObject, eventdata, handles)
% hObject    handle to other (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of other

if handles.prefs.pca.use_calls(1)==1
    set(handles.other,'value',0);
    handles.prefs.pca.use_calls(1)=0; guidata(hObject, handles);
else
    set(handles.other,'value',1);
    handles.prefs.pca.use_calls(1)=1; guidata(hObject, handles);
end
% --- 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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



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

mincallno=str2num(get(handles.edit1,'string'));
if mincallno>size(handles.z_scores,1)-8
    mincallno=size(handles.z_scores,1)-8;
    set(handles.edit1,'string',int2str(mincallno));
elseif mincallno>handles.prefs.pca.maxcallno
    mincallno=handles.prefs.pca.maxcallno;
    set(handles.edit1,'string',int2str(handles.prefs.pca.maxcallno));
elseif mincallno<1
    mincallno=1;
    set(handles.edit1,'string',int2str(1));
end
handles.prefs.pca.mincallno=mincallno; guidata(hObject, handles);

% --- 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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
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

maxcallno=str2num(get(handles.edit2,'string'));
if maxcallno>size(handles.z_scores,1)-8
    maxcallno=size(handles.z_scores,1)-8;
    set(handles.edit2,'string',int2str(maxcallno));
elseif maxcallno<1
    maxcallno=1;
    set(handles.edit2,'string',int2str(1));
elseif maxcallno<handles.prefs.pca.mincallno
    maxcallno=handles.prefs.pca.mincallno;
    set(handles.edit2,'string',int2str(handles.prefs.pca.mincallno));
end
handles.prefs.pca.maxcallno=maxcallno; guidata(hObject, handles);

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

% Hint: get(hObject,'Value') returns toggle state of checkbox11


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

handles.FIG = pca_win(handles.z_scores,handles.prefs,handles.markers); guidata(hObject, handles);

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

% Hint: get(hObject,'Value') returns toggle state of man_axes

if handles.prefs.pca.man_axes==0
    handles.prefs.pca.man_axes=1; guidata(hObject, handles);
    set(handles.man_axes,'value',1);
else
    handles.prefs.pca.man_axes=0; guidata(hObject, handles);
    set(handles.man_axes,'value',0);
end


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

% Hint: get(hObject,'Value') returns toggle state of datapoints

handles.prefs.pca.datapoints=get(handles.datapoints,'value'); guidata(hObject, handles);

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

% Hint: get(hObject,'Value') returns toggle state of datanumbers

handles.prefs.pca.datanumbers=get(handles.datanumbers,'value'); guidata(hObject, handles);


% --- Executes during object creation, after setting all properties.
function X_CreateFcn(hObject, eventdata, handles)
% hObject    handle to X (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



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


% --- Executes during object creation, after setting all properties.
function Y_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Y (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



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


% --- Executes during object creation, after setting all properties.
function Z_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Z (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



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


% --- Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit6 (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



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


% --- Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit7 (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



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


% --- Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit8 (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



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