function varargout = Auswertung(varargin)

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

% Last Modified by GUIDE v2.5 20-Mar-2012 15:20:20

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

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

% Update handles structure
guidata(hObject, handles);

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


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


% --- Daten Einlesen ( Spannung- Strom zurecht schneiden) -----------------
function pushbutton1_Callback(hObject, eventdata, handles)
global U
global I
% global U1
% global I1

uiload
uiload

% U1=zeros(1,1048576);                                                         %Vektor mit 2^20 Werte
% I1=zeros(1,1048576);
% 
% i=25000;                                                                    % 1%von 2500000
% 
% 
% while i<=1073576                                                           % 2^20+i
% 
% U1(1,i-24999)=U(2,i);
% I1(1,i-24999)=I(2,i);
% i=i+1;
% 
% end

set(handles.axes1, 'Position', [0.1 0.6 0.8 0.36]);
axes(handles.axes1);
plot(U);
xlabel('Werte');
ylabel('Spannung [V]');
title('Spannung');
Grid on;

set(handles.axes2, 'Position', [0.1 0.15 0.8 0.36]);
axes(handles.axes2);
plot(I);
xlabel('Werte');
ylabel('Strom [V]');
title('Strom');
Grid on;


% U=D(1,:);
% I=D(2,:);
% uisave('I','Strom_IPAT');
% uisave('U','Spannung_IPAT');
% set(handles.uipanel2, 'Position', [0 0 1 1]);
% daten=xlsread('Daten15mA.xlsx');   
% D=transpose(daten);
% 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)

% --- Daten aus dem Ozilloskop einlesen -----------------------------------
function pushbutton18_Callback(hObject, eventdata, handles)

global I; %Vektor Strom
global U; %Vektor Spannung                                                 

%Werte initialisieren

count=0;                                                                   
%Keine Funktion Zählt nur wie Oft der Trigger ausgelöst wurde                                                                       
%Verbindung aufbauen

DSO = actxcontrol('LeCroy.ActiveDSOCtrl.1'); %Lade ActiveDSO control
pause(0.05); %Kurz warten
invoke(DSO,'MakeConnection','IP:134.169.52.230'); %Weise IP zu
pause(0.05); %Kurz warten

%Osziloskop initialisieren
%invoke(DSO,'WriteString','C1:TRA ON', true); %Channel 1 aktivieren
%invoke(DSO,'WriteString','C1:OFFSET -0.6', true); %OFFSET einstellen
%invoke(DSO,'WriteString','C1:VDIV 0.2', true); %Volt/Divison einstellen
%zeit=get(handles.edit2,'String');
%string='C1:TDIV'+ ' ' + zeit + ' M';
%invoke(DSO,'WriteString','TDIV 10000.00 M',true); %Zeitbasis einstellen aktuell 20µs
%invoke(DSO,'WriteString','TRSE EDGE,SR,C1,HT,OFF',true); %Trigger einstellen: EDGE:Flanke , SR,C1:Source Ch1 , HT,OFF: Holdoff Time aus
%invoke(DSO,'WriteString','TRSL POS',true); %Auf Positive Flanke triggern
%invoke(DSO,'WriteString','TRLV 0.4',true); %Triggerlevel einstellen

%invoke(DSO,'WriteString','C2:TRA ON', true); %Channel 2 aktivieren
%invoke(DSO,'WriteString','C2:OFFSET -2', true); %OFFSET einstellen
%invoke(DSO,'WriteString','C2:VDIV 5', true); %Volt/Divison einstellen

%invoke(DSO,'WriteString','C3:TRA ON', true); %Channel 2 aktivieren
%invoke(DSO,'WriteString','C3:OFFSET -1', true); %OFFSET einstellen
%invoke(DSO,'WriteString','C3:VDIV 5', true); %Volt/Divison einstellen

%Mainloop 
%while(1)
    %modT=''; %modusTrigger leeren
    %invoke(DSO,'WriteString','TRMD SINGLE', true); %Trigger aktivieren
    
    invoke(DSO,'WriteString','CHDR OFF', true); % Oszi anweisen, dass nur der Wert der angefragten Variablen zurückgegeben wird
    
    %invoke(DSO,'WriteString','C1:TRMD?', true); % Trigger Modus auslesen
    % modT=invoke(DSO,'ReadString',6) % und in modT speichern
    %set(handles.edit1,'String',modT);
    %Programm solange warten lassen bis Trigger Modus des Oszis in STOPPED
    %geht. Wenn dies passiert wurde der Trigger aus gelöst und ein
    %Signalverlauf kann abgespeichert werden
    %while( strcmp(modT,'SINGLE'))
    %invoke(DSO,'WriteString','CHDR OFF', true);
    %invoke(DSO,'WriteString','C1:TRMD?', true);
    %modT=invoke(DSO,'ReadString',6); % Schreibe ID zurück
    %end
    %count=count+1 %Hochzählen und anzeigen wie oft getriggert wurde
    %set(handles.edit1,'String',modT);
    %Kurvenverlauf auslesen und in Array speichern
    
    channel1data=invoke(DSO,'GetScaledWaveformWithTimes','C1',5100000,0); % Get Wavefrom Data - 1 Mpts is chosen as the arbitrary maximum file transfer file size (substitute your own max value to use) 
    channel1data=double(channel1data); % umwandeln in double Werte

    channel2data=invoke(DSO,'GetScaledWaveformWithTimes','C2',5100000,0); % Get Wavefrom Data - 1 Mpts is chosen as the arbitrary maximum file transfer file size (substitute your own max value to use) 
    channel2data=double(channel2data); % umwandeln in double Werte
    
    channel1data(2,:)=channel1data(2,:)*(1/0.04); %Strom berechnen
    
    %invoke(DSO,'WriteString','CHDR OFF', true); % Oszi anweisen, dass nur der Wert der angefragten Variablen zurückgegeben wird
    %invoke(DSO,'WriteString','C2:TRMD?', true); % Trigger Modus auslesen
    %modT=invoke(DSO,'ReadString',6) % und in modT speichern
        
    % Daten Plotten
    pause(0.05);
    
    axes(handles.axes1);
    plot(handles.axes1,channel1data(1,:),channel1data(2,:), '.'); 
    title('Strom'); 
    %legend('Strom');
    xlabel('Sekunden'); 
    ylabel('Volt x Übersetzungsverhältnis'); % Volt 
    Grid on;
    
    axes(handles.axes2);
    plot(handles.axes2,channel2data(1,:),channel2data(2,:), '.'); 
    title('Spannung'); 
    %legend('Spannung');
    xlabel('Sekunden');
    ylabel('Volt '); % Volt 
    Grid on;
    
I=zeros(size(channel1data));
U=zeros(size(channel2data));

I=channel1data; %Strom
U=channel2data; %Spannung

uisave('I','Strom');
uisave('U','Spannung');

clear channel1data
clear channel2data

% Fertig mit daten einlesen


    %Aktuelle Zeit mit Datum und speichern in String Wandeln und anpassen
    %      d=(datestr(now));
    %      d=regexprep(d, ':', '_');
    %      d=regexprep(d, '-', '_');    
    %      d=regexprep(d, ' ', '_');    
    %       outputtxt=strcat('C:\haupt\Oszilloskop\',d,'.txt');
    %    csvwrite(outputtxt,M); 

invoke(DSO,'Disconnect'); % disconnect

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


% --- Grenzen für die FFT bilden ------------------------------------------
function pushbutton4_Callback(hObject, eventdata, handles)

global U
global I
global i
global n
global FI
global FU
global FFU
global FFI

uiload
uiload

n = 1048576                                                                %2^20 Werte Signallänge

FU=zeros(1,n);                                                             %Vektor mit 2^21 Werte
FI=zeros(1,n);
                                                                           % 1%von 250000
i=25000;                                                                   % 1%von 2500000


while i<=1073576                                                           % 2^20+i

FU(1,i-24999)=U(2,i);
FI(1,i-24999)=I(2,i);
i=i+1;

end

FFU=zeros(1,2*n);
FFI=zeros(1,2*n);
FFU(1,1:n)=FU(1,1:n);
FFI(1,1:n)=FI(1,1:n);
FFU(1,n+1:2*n)=-FU(1,1:n)+FU(1,n)+FU(1,1);                                  %FFT Signal 2^21 Werte
FFI(1,n+1:2*n)=-FI(1,1:n)+FI(1,n)+FI(1,1);                                  %FFT Signal 2^21 Werte

axes(handles.axes4);
plot(FFI(1,:),'.-');
title('Strom'); 
xlabel('Werte');                                                           
ylabel('Strom [A]');                                                       % Strom
Grid on;

axes(handles.axes3);
plot(FFU(1,:),'.-');
title('Spannung'); 
xlabel('Werte');                                                                    
ylabel('Spannung [V]');                                                    % Spannung
Grid on;


uisave('FFI','FFT_Stromsignal_IPAT');
uisave('FFU','FFT_Spannungsignal_IPAT');


% 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)


% --- Durchführen FFT -----------------------------------------------------
function pushbutton10_Callback(hObject, eventdata, handles)

global FFI
global FFU
global Fs
global FFT_U
global FFT_I

uiload
uiload

Fs=250000;                                                                 % Sampling frequency
T=1/Fs;                                                                    % Sample time
L=length(FFI);                                                             % Length of signal
t=(0:L-1)*T;                                                               % Time vector
NFFT = 2^nextpow2(L);                                                      % Next power of 2 from length of y
f = Fs/2*linspace(0,1,NFFT/2+1);                                           % frequenz

FFT_U=fft(FFU,NFFT)/L;              %FFT
FFT_I=fft(FFI,NFFT)/L;

axes(handles.axes5);
cla;
plot(f,(FFT_U(1:NFFT/2+1)),'.');
xlabel('Frequency (Hz)');
ylabel('|FFT_U(f)|');
title('FFT');
Grid on;

axes(handles.axes6);
cla;
plot(f,(FFT_I(1:NFFT/2+1)),'.');
xlabel('Frequency (Hz)')
ylabel('|FFT_I(f)|')
Grid on;

uisave('NFFT','NFFT');
uisave('f','Frequenz');
uisave('FFT_I','FFT_I_Ergebnisse_IPAT');
uisave('FFT_U','FFT_U_Ergebnisse_IPAT');

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


% --- Impedanz und Admittanz berechnen ------------------------------------
function pushbutton19_Callback(hObject, eventdata, handles)

global FFT_U
global FFT_I
global Z
global Y
global f
global NFFT

uiload
uiload
uiload
uiload

Z=FFT_U./FFT_I;
Y=FFT_I./FFT_U;

axes(handles.axes5);
cla;
plot(f,(Z(1:NFFT/2+1)),'.');
xlabel('Frequency (Hz)');
ylabel('Z');
title('FFT');
Grid on;

axes(handles.axes6);
cla;
plot(f,(Y(1:NFFT/2+1)),'.');
xlabel('Frequency (Hz)')
ylabel('Y')
Grid on;

uisave('Z','Ergebnisse_IPAT');
uisave('Y','Ergebnisse_IPAT');
% hObject    handle to pushbutton19 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)



% --- Bodediagramm --------------------------------------------------------
function pushbutton20_Callback(hObject, eventdata, handles)

global Z
global f
global n
global d

uiload                                                                     % Frequenz laden
uiload                                                                     % Z/Y laden

n=str2double(get(handles.edit1,'String'));
d=str2double(get(handles.edit2,'String'));

axes(handles.axes5);
cla;
semilogx(f(1:d:n),abs(Z(1:d:n)),'.');
ylabel('Betrag [Z]');
title('Bode-Diagramm');
Grid on;

axes(handles.axes6);
cla;
semilogx(f(1:d:n),atan(Z(1:d:n)),'.-');
xlabel('Frequenz [Hz]');
ylabel('Phi');
Grid on;

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



% --- Bode-Diagramm (mittel)-----------------------------------------------
function pushbutton26_Callback(hObject, eventdata, handles)

global f
global fa
global fm
global Z
global Y
global M

load('Frequenz.mat');
                                                                           %Frequenzmittelvektor
fa(1)=f(1);
fa(2:1048577)=f(2:2:1048577);

fm(1:100)=fa(1:100);
fm(101:109)=mean(reshape(fa(100:999),100,[]));
fm(110:118)=mean(reshape(fa(1000:9999),1000,[]));
fm(119:127)=mean(reshape(fa(10000:99999),10000,[]));
fm(128:136)=mean(reshape(fa(100000:999999),100000,[]));
%fm(73:76)=mean(reshape(fa(1000000:1039999),10000,[]));

uiopen      
                                                                           %Ergebnismittelwerte
Y(1)=Z(1);
Y(2:1048577)=Z(2:2:2097152); %ohne NST

A=Y(1:100);
B=mean(reshape(Y(100:999),100,[]));
C=mean(reshape(Y(1000:9999),1000,[]));
D=mean(reshape(Y(10000:99999),10000,[]));
E=mean(reshape(Y(100000:999999),100000,[]));
% F=mean(reshape(Y(1000000:1039999),10000,[]));

M=zeros(136,1);
M(1:100)=A;
M(101:109)=B;
M(110:118)=C;
M(119:127)=D;
M(128:136)=E;


axes(handles.axes5);
cla;
semilogx(fm, abs(M),'r.-');
hold on;
%axis([0.1,250000,0,30])
ylabel('Betrag [Z]');
title('Bode-Diagramm');
Grid on;

axes(handles.axes6);
cla;
semilogx(fm, atan(M),'.-'); 
xlabel('Frequenz [Hz]');
ylabel('Phi');
%title('Winkel Phi');
Grid on;


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



% --- Nyquistdiagramm -----------------------------------------------------
function pushbutton13_Callback(hObject, eventdata, handles)

global Z
global n
global d
global Y
uiload

n=str2double(get(handles.edit3,'String'));
d=str2double(get(handles.edit4,'String'));


axes(handles.axes8);
cla;
hold on;
plot(real(Z(1:d:n)), imag(Z(1:d:n)),'.-');
%axis([-3,0.5,-0.1,1])
xlabel('Realteil [Z]');
ylabel('Imaginärteil [Z]');
title('Nyquist-Diagramm');
Grid on;

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



% --- Nyquist(mittel) -----------------------------------------------------
function pushbutton27_Callback(hObject, eventdata, handles)

global M
global A
global B
global C
global Y
global n

uiopen
                                                                           % load('0_Ergebnisse.mat');
n=32;                                                                      %str2double(get(handles.edit3,'String'));
Y(1)=Z(1);
Y(2:1048577)=Z(2:2:2097152); %ohne NST

A=Y(1:10);
B=mean(reshape(Y(10:99),5,[]));
C=mean(reshape(Y(100:999),5,[]));
% D=mean(reshape(Y(1100:9099),2000,[]));
% E=mean(reshape(Y(10000:109999),20000,[]));
% F=mean(reshape(Y(1000000:1039999),10000,[]));

M=zeros(32,1);
M(1:10)=A;
M(11:28)=B;
% M(29:33)=C;
% M(25:28)=D;
% M(29:33)=E;


axes(handles.axes8);
cla;
plot(-real(M(2:n)), -imag(M(2:n)),'.-'); 
shading interp;
xlabel('Realteil [Z]');
ylabel('Imaginärteil [Z]');
title('Nyquist-Diagramm');
Grid on;

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

% --- Vergleich mit EIS ---------------------------------------------------
function pushbutton17_Callback(hObject, eventdata, handles)

global daten
global D
global D2
global Zre
global Zim
global Z2re
global Z2im
global Z2
global Z3


daten=xlsread('EIS DQ1.xlsx');   
D=transpose(daten);

Zre=D(2,:);
Zim=D(3,:);

Z2=Zre+i*Zim;

daten=xlsread('EIS DQ2.xlsx');   
D2=transpose(daten);

Z2re=D2(2,:);
Z2im=D2(3,:);

Z3=Z2re+i*Z2im;

uiopen
n=str2double(get(handles.edit1,'String'));
d=str2double(get(handles.edit2,'String'));


axes(handles.axes8);
cla;
hold on;
plot(real(Z(2:d:n)),imag(Z(2:d:n)),'b.');
plot(real(Z2), imag(Z2),'r.-');
plot(real(Z3), imag(Z3),'g.-');
%axis([-3,0.5,-0.1,1])
xlabel('Realteil [Z]');
ylabel('Imaginärteil [Z]');
title('Nyquist-Diagramm');
Grid on;

% hObject    handle to pushbutton17 (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 pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)

    set(handles.uipanel2, 'Visible', 'off');
   
    set(handles.uipanel3, 'Visible', 'on');
    set(handles.uipanel3, 'Position', [0 0 1 1]);
    set(handles.axes3, 'Position', [0.1 0.6 0.8 0.36]);
    set(handles.axes4, 'Position', [0.1 0.15 0.8 0.36]);

% 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)


% --------------------------------------------------------------------
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 pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)

set(handles.uipanel5, 'Visible', 'off');
    
set(handles.uipanel4, 'Visible', 'on');
set(handles.uipanel4, 'Position', [0 0 1 1]);
set(handles.axes5, 'Position', [0.1 0.6 0.7 0.36]);
set(handles.axes6, 'Position', [0.1 0.2 0.7 0.36]);
% hObject    handle to pushbutton8 (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 pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)

set(handles.uipanel4, 'Visible', 'off');
    
set(handles.uipanel3, 'Visible', 'on');
set(handles.uipanel3, 'Position', [0 0 1 1]);
set(handles.axes3, 'Position', [0.1 0.6 0.8 0.36]);
set(handles.axes4, 'Position', [0.1 0.15 0.8 0.36]);

% 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)


% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)

set(handles.uipanel4, 'Visible', 'off');
    
set(handles.uipanel5, 'Visible', 'on');
set(handles.uipanel5, 'Position', [0 0 1 1]);
set(handles.axes6, 'Position', [0.1 0.15 0.8 0.8]);
% 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)


% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)

set(handles.uipanel3, 'Visible', 'off');
    
set(handles.uipanel4, 'Visible', 'on');
set(handles.uipanel4, 'Position', [0 0 1 1]);
set(handles.axes5, 'Position', [0.1 0.6 0.7 0.36]);
set(handles.axes6, 'Position', [0.1 0.2 0.7 0.36]);
% 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)


% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)

set(handles.uipanel3, 'Visible', 'off');
    
set(handles.uipanel2, 'Visible', 'on');
set(handles.uipanel2, 'Position', [0 0 1 1]);
set(handles.axes1, 'Position', [0.1 0.6 0.8 0.36]);
set(handles.axes2, 'Position', [0.1 0.15 0.8 0.36]);
% 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)

% --- 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 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 pushbutton18_CreateFcn(hObject, eventdata, handles)
% hObject    handle to pushbutton18 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

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



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
