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

% Copyright 2002-2003 The MathWorks, Inc.

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

% Last Modified by GUIDE v2.5 25-May-2008 15:39:00

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


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

% Update handles structure
guidata(hObject, handles);

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


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

%Simulace sireni dvou impulsu optickym vlaknem s PMD
%impulsy na blizkych vlnovych delkach -> chromaticka disperze, nelinearni
%koef vlakna a utlum vlakna stejny pro oba pulsy 
figure(1);
close figure 1;
figure(2);
close figure 2;
i=sqrt(-1);c=3e8;       %konstanty
%vstupni parametry--------------------------------------------------------
P0=str2num(get(handles.editP0,'String'));
alfadB=str2num(get(handles.editutlum,'String'));
Dcd=str2num(get(handles.editdisperze,'String'));
d1=str2num(get(handles.editd1,'String'));
d2=str2num(get(handles.editd2,'String'));
d3=str2num(get(handles.editd3,'String'));
lambda=str2num(get(handles.editlambda,'String'));
n2=str2num(get(handles.editn2,'String'));
Aef=str2num(get(handles.editAef,'String'));
z=str2num(get(handles.editz,'String'));
dz=str2num(get(handles.editdz,'String'));
T0=str2num(get(handles.editT0,'String'));
C=str2num(get(handles.editC,'String'));
m=str2num(get(handles.editm,'String'));
N=str2num(get(handles.editcasvektor,'String'));
okno=str2num(get(handles.editokno,'String'));
pp=str2num(get(handles.editpocpulsu,'String'));
%-------------------------------------------------------------------------
beta2=-Dcd*1e-24*((lambda)^2)/(2*pi*c);%disperzni koef 2.r, s^2/m
gamma=(2*pi*n2*1e17)/(lambda*Aef);  %nelinearni koef vlakna, 1/W*m
T0=(T0/2)*1e-12;
h=z/dz;                                             %pocet kroku vypoctu
dz=dz*1000;                                         %km -> m
alfa=(2*alfadB/4.343)/1000;                         %utlum vlakna 1/m
t=-(okno/2)*1e-12:(okno*1e-12)/(N-1):(okno/2)*1e-12;%casovy vektor
dt=(okno*1e-12)/(N-1);                              %casovy element
for kk=1:pp,
A=sqrt(P0)*exp(-(1+i*C)*(t/T0).^(2*m));             %gauss puls 1
B=sqrt(P0)*exp(-(1+i*C)*(t/T0).^(2*m));             %gauss puls 2
Ax=A/2;
Ay=A/2;
Bx=B/2;
By=B/2;
if kk==1,
    figure(1);
    subplot(1,2,1);
    plot(t*1e12,abs(A)/sqrt(P0),'b');
    xlabel('time [ps]');
    ylabel('normalized power');
    title('lambda 1');
    grid on;hold on;
    subplot(1,2,2);
    plot(t*1e12,abs(B)/sqrt(P0),'b');
    xlabel('time [ps]');
    ylabel('normalized power');
    title('lambda 2');
    grid on;hold on;    
    l=length(A);
    dw=2*pi*1/(dt*l);
    w=(-1*l/2:1:l/2-1)*dw;
    w=fftshift(w);
end;
spAx=fft(Ax);
spAy=fft(Ay);
spBx=fft(Bx);
spBy=fft(By);
for k=1:h,
    spAx=spAx.*exp(-(alfa/2)*(dz/2)-i*w*(d1/2)*(dz/2)+...
         i*w.^2*(beta2/2)*(dz/2));
    spAy=spAy.*exp(-(alfa/2)*(dz/2)+i*w*(d1/2)*(dz/2)+...
         i*w.^2*(beta2/2)*(dz/2));
    spBx=spBx.*exp(-(alfa/2)*(dz/2)-i*w*(d2+d1/2)*(dz/2)+...
         i*w.^2*(beta2/2)*(dz/2));
    spBy=spBy.*exp(-(alfa/2)*(dz/2)-i*w*(d3+d1/2)*(dz/2)+...
         i*w.^2*(beta2/2)*(dz/2));
    Ax=ifft(spAx);
    Ay=ifft(spAy);
    Bx=ifft(spBx);
    By=ifft(spBy);
    Ax=Ax.*exp(i*gamma*((abs(Ax).^2)+2*(abs(Bx).^2)+...
       (2/3)*(abs(Ay).^2)+(2/3)*(abs(By).^2))*dz);
    Ay=Ay.*exp(i*gamma*((abs(Ay).^2)+2*(abs(By).^2)+...
       (2/3)*(abs(Ax).^2)+(2/3)*(abs(Bx).^2))*dz);
    Bx=Bx.*exp(i*gamma*((abs(Bx).^2)+2*(abs(Ax).^2)+...
       (2/3)*(abs(By).^2)+(2/3)*(abs(Ay).^2))*dz);
    By=By.*exp(i*gamma*((abs(By).^2)+2*(abs(Ay).^2)+...
       (2/3)*(abs(Bx).^2)+(2/3)*(abs(Ax).^2))*dz);
    spAx=fft(Ax);
    spAy=fft(Ay);
    spBx=fft(Bx);
    spBy=fft(By);
    spAx=spAx.*exp(-(alfa/2)*(dz/2)-i*w*(d1/2)*(dz/2)+...
         i*w.^2*(beta2/2)*(dz/2));
    spAy=spAy.*exp(-(alfa/2)*(dz/2)+i*w*(d1/2)*(dz/2)+...
         i*w.^2*(beta2/2)*(dz/2));
    spBx=spBx.*exp(-(alfa/2)*(dz/2)-i*w*(d2+d1/2)*(dz/2)+...
         i*w.^2*(beta2/2)*(dz/2));
    spBy=spBy.*exp(-(alfa/2)*(dz/2)-i*w*(d3+d1/2)*(dz/2)+...
         i*w.^2*(beta2/2)*(dz/2));
    Ax=ifft(spAx);
    Ay=ifft(spAy);
    Bx=ifft(spBx);
    By=ifft(spBy);    
   if k>1,          %navrat do vychozi pozice vektoru x,y
       Ax1=Ax;
       Ay1=Ay;
       Bx1=Bx;
       By1=By;       
       Ax=[cos(theta(1)) -exp(i*fii(1))*sin(theta(1))]*[Ax1;Ay1];
       Ay=[exp(-i*fii(1))*sin(theta(1)) cos(theta(1))]*[Ax1;Ay1];
       Bx=[cos(theta(2)) -exp(i*fii(2))*sin(theta(2))]*[Bx1;By1];
       By=[exp(-i*fii(2))*sin(theta(2)) cos(theta(2))]*[Bx1;By1];
   end;
   if k<h,          %nahodna elipticka rotace vektoru x,y
       theta=2*pi*rand(1,2);
       fii=2*pi*rand(1,2);
       Ax1=Ax;
       Ay1=Ay;
       Bx1=Bx;
       By1=By;
       Ax=[cos(theta(1)) exp(i*fii(1))*sin(theta(1))]*[Ax1;Ay1];
       Ay=[-exp(-i*fii(1))*sin(theta(1)) cos(theta(1))]*[Ax1;Ay1];           
       Bx=[cos(theta(2)) exp(i*fii(2))*sin(theta(2))]*[Bx1;By1];
       By=[-exp(-i*fii(2))*sin(theta(2)) cos(theta(2))]*[Bx1;By1];
   end;
    spAx=fft(Ax);
    spAy=fft(Ay);
    spBx=fft(Bx);
    spBy=fft(By);
end;
Ax=ifft(spAx);
Ay=ifft(spAy);
Bx=ifft(spBx);
By=ifft(spBy);
A=abs(Ax)+abs(Ay);
B=abs(Bx)+abs(By);
if kk==1 & get(handles.checkbox1,'Value')==0,
    figure(2);
end;
subplot(1,2,1);
plot(t*1e12,A/sqrt(P0),'r');
grid on;hold on;
subplot(1,2,2);
plot(t*1e12,B/sqrt(P0),'r');
grid on;hold on;
end;
pp=num2str(pp);
pp=[pp 'x output'];
for ll=1:2,
    figure(1);
    subplot(1,2,ll);
    if get(handles.checkbox1,'Value')==1,
        legend('input',pp);
    else
        legend('input');
        figure(2);
        subplot(1,2,ll);
        legend(pp);
    end;
end;


% --- Executes on button press in konec.
function konec_Callback(hObject, eventdata, handles)
% hObject    handle to konec (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 editP0_Callback(hObject, eventdata, handles)
% hObject    handle to editP0 (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 editP0 as text
%        str2double(get(hObject,'String')) returns contents of editP0 as a double


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


% --- Executes during object creation, after setting all properties.
function editpocpulsu_CreateFcn(hObject, eventdata, handles)
% hObject    handle to editpocpulsu (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 button press in checkbox1.
function checkbox1_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox1 (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 checkbox1


