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

% Last Modified by GUIDE v2.5 31-Mar-2008 10:07:02

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

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

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes diplomka wait for user response (see UIRESUME)
% uiwait(handles.figure1);
axes(handles.axes4)
plot(0,'Parent',handles.axes4); xlabel('Čas [s]');ylabel('Napětí [mV]');
axes(handles.axes5)
plot(0,'Parent',handles.axes5); xlabel('Čas [s]');ylabel('Napětí [mV]'); 

% --- Outputs from this function are returned to the command line.
function varargout = diplomka_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)

% zadaní začátku a konce klasifikovaného signálu
zacatek=str2num(get(findobj('Tag','edit1'),'String'));
konec=str2num(get(findobj('Tag','edit2'),'String'));
zacatek=zacatek+1;
% nactení dat
[data Path]=uigetfile('*.dat','Physionet(*.dat)','Vyberte příslušný soubor');
ff=fopen(data,'r');
fseek(ff,0,'bof');
f=fread(ff,1300000,'bit12');
f=f';fclose(ff);
x = f(1:2:1300000);

% prikaz cla smaze grafy pred dalsi klasifikaci
cla(handles.axes5)
axes(handles.axes4)
cla
% prevod osy x ze vzorku na cas
fvz=360;
osax=0:1/fvz:length(x(zacatek:konec))/fvz;
osax=osax(1:end-1);
% zobrazení
plot(osax,x(zacatek:konec),'Parent',handles.axes4); xlabel('Čas [s]');ylabel('Napětí [mV]'); 
zoom on
axis tight

% nacteni informaci o pacientovy z TXT
data(5:7)='txt';
fid=fopen(data);
hlavicka=fread(fid)';
hlavicka=char(hlavicka);
set(findobj('Tag','edit11'),'String',hlavicka);

% aktivace tlacitka filtruj
set(findobj('Tag','pushbutton5'),'enable', 'on');

% ulození promenych pro dalsi tlacitka
handles.zacatek=zacatek;
handles.konec=konec;
handles.x(zacatek:konec)=x(zacatek:konec);
handles.data=data;
H=gcf;
guidata(H,handles);

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

% nacteni promennych
zacatek=handles.zacatek;
konec=handles.konec;
x(zacatek:konec)=handles.x(zacatek:konec);

% filtrace pomoci HP fm=2Hz
rad=360/2;d=x(zacatek:konec);
% ................................................
drift=filter(1/rad*[1 zeros(1,rad-1) -1],[1 -1 zeros(1,rad-1)],d); %Lynn
drift=filter(1/rad*[1 zeros(1,rad-1) -1],[1 -1 zeros(1,rad-1)],drift); %Lynn
data100=d(1:end-(rad-1))-drift(rad:end);
% zobrazeni vyfiltovanych dat
axes(handles.axes4)
cla
% prevod osy x ze vzorku na cas
fvz=360;
osax=0:1/fvz:length(data100)/fvz;
osax=osax(1:end-1);
plot(osax(180:end),data100(180:end),'Parent',handles.axes4); xlabel('Čas [s]');ylabel('Napětí [mV]');
axis tight
zoom on
hold on

% figure()
% plot(osax(180:end),data100(180:end)); xlabel('Čas [s]');ylabel('Napětí [mV]');

% aktivace tlacitka klasifikuj
set(findobj('Tag','pushbutton2'),'enable', 'on');

% ulození promenych pro dalsi tlacitka
handles.data100=data100;
handles.osax=osax;
H=gcf;
guidata(H,handles);


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

% nacteni promennych
konec=handles.konec;
zacatek=handles.zacatek;
data=handles.data;
data100=handles.data100;
osax=handles.osax;
% aktivace tlacitka klasifikuj
set(findobj('Tag','pushbutton7'),'enable', 'on');

% nacteni pozic R-R intervalu
data(5:7)='XLS';
pozice_R = xlsread(data);

% upraveni signálu, aby jsme nezobrazovali nic jineho nez nasich 5 signalu
tt=pozice_R(:,2);
pom1=isnan(tt);
for iii = 1:length(pom1)
    if pom1(iii)==0;
       pom2(iii,:) = pozice_R(iii,:);
    else pom1(iii)~=0;
       pom2(iii,:) = [-1 -1 -1];
    end
end
pom2=pom2(pom2>-0.5);pozice_R = reshape(pom2,length(pom2)/3,3);

% vybere jen vzorky ktere jsme si zadali jako min a max
pom3 = pozice_R(:,1);
a=pom3(pom3>zacatek); 
b=a(a<konec);
for ii=1:length(b)
    for jj=1:length(pom3)
        if pom3(jj) == b(ii)
           B(ii,:) = pozice_R(jj,:);
        end
    end
end
B=B(2:end-3,:);

% vytvori vektor pom4 ktery je slozen z jednotlivych EKG (kazdy sloupec jedno EKG)
y=200;x=72;
Vectormin = B(:,1);
Vectormin = minus(Vectormin,zacatek);
Vectormin = Vectormin-x;
a100=0; pom4=zeros(y,length(Vectormin));
for i100=1:length(Vectormin)
    for a100=1:y
        pom4(a100,i100)=data100(Vectormin(i100)+a100);
    end
end

A=[];
for it=1:length(Vectormin)
    A(:,it)= osax(Vectormin(it)+73);
end
% vzkresleni idealnich klasifikaci
velikost=pom4(73,:);
a100 = B(:,2)';
vzorek = A';
clc
for iii = 1:length(a100)
    if a100(:,iii) == 0
    plot((vzorek(iii)),velikost(iii),'bx','Parent',handles.axes4);
    elseif a100(:,iii) == 1
    plot((vzorek(iii)),velikost(iii),'gx','Parent',handles.axes4);
    elseif a100(:,iii) == 2
    plot((vzorek(iii)),velikost(iii),'go','Parent',handles.axes4);
    elseif a100(:,iii) == 5
    plot((vzorek(iii)),velikost(iii),'ro','Parent',handles.axes4);
    elseif a100(:,iii) == 9
    plot((vzorek(iii)),velikost(iii),'co','Parent',handles.axes4);
    end
end
zoom off

matN100=[];matA100=[];matL100=[];matR100=[];matV100=[];matP100=[];
for i100 = 1:length(a100)
    if a100(:,i100)==0;
       matN100(:,i100) = pom4(:,i100);
    elseif a100(:,i100)==3;
       matA100(:,i100) = pom4(:,i100);
    elseif a100(:,i100)==1;
       matL100(:,i100) = pom4(:,i100);
    elseif a100(:,i100)==2;
       matR100(:,i100) = pom4(:,i100);
    elseif a100(:,i100)==5;
       matV100(:,i100) = pom4(:,i100);
    elseif a100(:,i100)==9;
       matP100(:,i100) = pom4(:,i100);
    end
end

matN100 = matN100(matN100~=0);
matN100 = reshape(matN100,y,length(matN100)/y);
matL100 = matL100(matL100~=0);matL100 = reshape(matL100,y,length(matL100)/y);
matR100 = matR100(matR100~=0);matR100 = reshape(matR100,y,length(matR100)/y);
matA100 = matA100(matA100~=0);matA100 = reshape(matA100,y,length(matA100)/y);
matV100 = matV100(matV100~=0);matV100 = reshape(matV100,y,length(matV100)/y);
matP100 = matP100(matP100~=0);matP100 = reshape(matP100,y,length(matP100)/y);

% ...........................simulace N.......................
load netN;load netL;load netR;load netV;load netP;
OutputVector_N = sim(netN,matN100);
OutputVector_L = sim(netL,matN100);
OutputVector_R = sim(netR,matN100);
OutputVector_V = sim(netV,matN100);
OutputVector_P = sim(netP,matN100);

vysledek1 = [OutputVector_N;OutputVector_L;OutputVector_R;OutputVector_V;OutputVector_P;];
body=max(vysledek1);delka=length(body);
for i=1:1:delka
    x=vysledek1(:,i);
    x(x<body(i))=0; x(x==body(i))=1;
    vysledek1(:,i)=x;
end

N=0;
for ii=1:1:length(vysledek1)
if vysledek1(:,(ii))==[1;0;0;0;0]
   N=N+1;
end
end

delka=size(matN100);
Nideal=delka(2);
chybaN = 100 -(N/Nideal*100);
chybaN = round(chybaN*100)/100;
chybaN=num2str(chybaN);set(findobj('Tag','edit4'),'String',chybaN);

% ...........................simulace L.......................
OutputVector_N = sim(netN,matL100);
OutputVector_L = sim(netL,matL100);
OutputVector_R = sim(netR,matL100);
OutputVector_V = sim(netV,matL100);
OutputVector_P = sim(netP,matL100);

vysledek2 = [OutputVector_N;OutputVector_L;OutputVector_R;OutputVector_V;OutputVector_P;];
body=max(vysledek2);delka=length(body);
for i=1:1:delka
    x=vysledek2(:,i);
    x(x<body(i))=0; x(x==body(i))=1;
    vysledek2(:,i)=x;
end

L=0;
pom32pom32=size(vysledek2);
for ii=1:1:pom32pom32(1,2)
if vysledek2(:,(ii))==[0;1;0;0;0]
   L=L+1;
end
end

delka=size(matL100);
Lideal=delka(2);
chybaL=100-(L/Lideal*100);
chybaL = round(chybaL*100)/100;
chybaL=num2str(chybaL);set(findobj('Tag','edit5'),'String',chybaL);

% ...........................simulace R.......................
OutputVector_N = sim(netN,matR100);
OutputVector_L = sim(netL,matR100);
OutputVector_R = sim(netR,matR100);
OutputVector_V = sim(netV,matR100);
OutputVector_P = sim(netP,matR100);

vysledekR = [OutputVector_N;OutputVector_L;OutputVector_R;OutputVector_V;OutputVector_P;];

body=max(vysledekR);delka=length(body);
for i=1:1:delka
    x=vysledekR(:,i);
    x(x<body(i))=0; x(x==body(i))=1;
    vysledekR(:,i)=x;
end

R=0;
fff=size(vysledekR);
for ii=1:1:fff(1,2)
if vysledekR(:,(ii))==[0;0;1;0;0]
   R=R+1;
end
end

delka=size(matR100);
Rideal=delka(2);
chybaR=100-(R/Rideal*100);
chybaR = round(chybaR*100)/100;
chybaR=num2str(chybaR);set(findobj('Tag','edit6'),'String',chybaR);

% ...........................simulace V.......................
OutputVector_N = sim(netN,matV100);
OutputVector_L = sim(netL,matV100);
OutputVector_R = sim(netR,matV100);
OutputVector_V = sim(netV,matV100);
OutputVector_P = sim(netP,matV100);

vysledekV = [OutputVector_N;OutputVector_L;OutputVector_R;OutputVector_V;OutputVector_P;];
body=max(vysledekV);delka=length(body);
for i=1:1:delka
    x=vysledekV(:,i);
    x(x<body(i))=0; x(x==body(i))=1;
    vysledekV(:,i)=x;
end

V=0;
fff=size(vysledekV);
for ii=1:1:fff(1,2)
if vysledekV(:,(ii))==[0;0;0;1;0]
   V=V+1;
end
end

delka=size(matV100);
Videal=delka(2);
chybaV=100-(V/Videal*100);
chybaV = round(chybaV*100)/100;
chybaV=num2str(chybaV);set(findobj('Tag','edit8'),'String',chybaV);

% ...........................simulace P.......................
OutputVector_N = sim(netN,matP100);
OutputVector_L = sim(netL,matP100);
OutputVector_R = sim(netR,matP100);
OutputVector_V = sim(netV,matP100);
OutputVector_P = sim(netP,matP100);

vysledekP = [OutputVector_N;OutputVector_L;OutputVector_R;OutputVector_V;OutputVector_P;];
body=max(vysledekP);delka=length(body);
for i=1:1:delka
    x=vysledekP(:,i);
    x(x<body(i))=0; x(x==body(i))=1;
    vysledekP(:,i)=x;
end

P=0;
fff=size(vysledekP);
for ii=1:1:fff(1,2)
if vysledekP(:,(ii))==[0;0;0;0;1]
   P=P+1;
end
end

delka=size(matP100);
Pideal=delka(2);
chybaP=100-(P/Pideal*100);
chybaP = round(chybaP*100)/100;
chybaP=num2str(chybaP);set(findobj('Tag','edit9'),'String',chybaP);

% ...........................simulace - konecna............................
OutputVector_N = sim(netN,pom4);
OutputVector_L = sim(netL,pom4);
OutputVector_R = sim(netR,pom4);
OutputVector_V = sim(netV,pom4);
OutputVector_P = sim(netP,pom4);
vysledek = [OutputVector_N;OutputVector_L;OutputVector_R;OutputVector_V;OutputVector_P;];
body=max(vysledek);delka=length(body);
for i=1:1:delka
    x=vysledek(:,i);
    x(x<body(i))=0; x(x==body(i))=1;
    vysledek(:,i)=x;
end

axes(handles.axes5)
cla
% prevod osy x ze vzorku na cas
fvz=360;
osax=0:1/fvz:length(data100)/fvz;
osax=osax(1:end-1);
plot(osax(180:end),data100(180:end),'Parent',handles.axes5);
zoom on
hold on
axis tight
kk=size(vysledek);kk=kk(2);
for iii = 1:kk
    if vysledek(:,iii) == [1;0;0;0;0]
    plot((vzorek(iii)),velikost(iii),'bx','Parent',handles.axes5);
    hold on
    elseif vysledek(:,iii) == [0;1;0;0;0]
    plot((vzorek(iii)),velikost(iii),'gx','Parent',handles.axes5);
    hold on
    elseif vysledek(:,iii) == [0;0;1;0;0]
    plot((vzorek(iii)),velikost(iii),'go','Parent',handles.axes5);
    hold on
    elseif vysledek(:,iii) == [0;0;0;1;0]
    plot((vzorek(iii)),velikost(iii),'ro','Parent',handles.axes5);
    hold on
    elseif vysledek(:,iii) == [0;0;0;0;1]
    plot((vzorek(iii)),velikost(iii),'co','Parent',handles.axes5);
    end
end
xlabel('Čas [s]');ylabel('Napětí [mV]');
hold off

% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
v = axis(handles.axes5);
axis(handles.axes4,v);

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

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)

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)

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)

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)

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)

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

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)

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

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

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

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

function edit9_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit9 (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 edit11_Callback(hObject, eventdata, handles)
% hObject    handle to edit11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

function edit11_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit11 (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





