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

% Last Modified by GUIDE v2.5 04-Jun-2009 12:20:25

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

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = Signal_spline_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)
[band_signal]=importdata('C:\Dokumente und Einstellungen\dnAuswerte.PC183-S74\Desktop\frequenzband\AllFband.mat');
band_signal.Frequenzband;
band1=Inter_Fband(band_signal.Frequenzband);

 set (handles.uitable1,'Data',band1); 
 
f=str2double(get(handles.edit1,'string'));    % eingegebene Frequenz
w2=str2double(get(handles.edit3,'string'));   % eingegebene Winkelbereich
w1=str2double(get(handles.edit2,'string'));
a=size(band1);
m=a(1);
n=a(2);
for x1=2:1:m/2
    for x2=(m/2)+1:1:m
        for y=2:1:n
            if band1(x1,1)==w1
                 if band1(x2,1)==w2
                    if band1(1,y)==f
                   x=x1:x2;
                   plot(band1(x,1),band1(x,y))
           
                    end
                 end
            end
        end
    end
end

% --- 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)
band_signal=importdata('C:\Dokumente und Einstellungen\dnAuswerte.PC183-S74\Desktop\frequenzband\AllFband.mat');
band_signal.a;
band3=Sim_inter(band_signal.a);

set (handles.uitable1,'Data',band3); 

f=str2double(get(handles.edit1,'string'));
w2=str2double(get(handles.edit3,'string'));
w1=str2double(get(handles.edit2,'string'));
a=size(band3);
m=a(1);
n=a(2);
for x1=2:1:m/2
for x2=(m/2)+1:1:m
    for y=2:1:n
       if band3(x1,1)==w1
           if band3(x2,1)==w2
               if band3(1,y)==f
                   x=x1:x2;
                  plot(band3(x,1),band3(x,y))
                
               end
           end
       end
    end
end
end


% --- 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)
[band_signal]=importdata('C:\Dokumente und Einstellungen\dnAuswerte.PC183-S74\Desktop\frequenzband\AllFband.mat');
band_signal.Frequenzband;
band1=Inter_Fbandspline(band_signal.Frequenzband);

 set (handles.uitable1,'Data',band1); 
 
f=str2double(get(handles.edit1,'string'));    % eingegebene Frequenz
w2=str2double(get(handles.edit3,'string'));   % eingegebene Winkelbereich
w1=str2double(get(handles.edit2,'string'));
a=size(band1);
m=a(1);
n=a(2);
for x1=2:1:m
for x2=(m/2)+1:1:m
    for y=2:1:n
       if band1(x1,1)==w1
           if band1(x2,1)==w2
               if band1(1,y)==f
                   x=x1:x2;
                   plot(band1(x,1),band1(x,y))
                  
               end
           end
       end
    end
end
end

% --- 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)
band_signal=importdata('C:\Dokumente und Einstellungen\dnAuswerte.PC183-S74\Desktop\frequenzband\AllFband.mat');
band_signal.a;
band3=Sim_interspline(band_signal.a);

set (handles.uitable1,'Data',band3); 

f=str2double(get(handles.edit1,'string'));
w2=str2double(get(handles.edit3,'string'));
w1=str2double(get(handles.edit2,'string'));
a=size(band3);
m=a(1);
n=a(2);
for x1=2:1:m/2
for x2=(m/2)+1:1:m
    for y=2:1:n
       if band3(x1,1)==w1
           if band3(x2,1)==w2
               if band3(1,y)==f
                   x=x1:x2;
                   plot(band3(x,1),band3(x,y))
               end
           end
       end
    end
end
end


% --- 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)
%VNA_linear=str2double(get(handles.pushbutton1,'string')); 
%set (handles.axes1,'String',VNA_linear);
[band_signal]=importdata('C:\Dokumente und Einstellungen\dnAuswerte.PC183-S74\Desktop\frequenzband\AllFband.mat');
band_signal.Frequenzband;
band_l=Inter_Fband(band_signal.Frequenzband);
band_s=Inter_Fbandspline(band_signal.Frequenzband);
 
f=str2double(get(handles.edit1,'string'));    % eingegebene Frequenz
w2=str2double(get(handles.edit3,'string'));   % eingegebene Winkelbereich
w1=str2double(get(handles.edit2,'string'));
a=size(band_l);
m=a(1);
n=a(2);
for x1=2:1:m/2
    for x2=(m/2)+1:1:m
        for y=2:1:n
            if band_l(x1,1)==w1
                 if band_l(x2,1)==w2
                    if band_l(1,y)==f
                   x=x1:1:x2;
                   plot(band_l(x,1),band_l(x,y),'b',band_s(x,1),band_s(x,y),'r')
                 
                    end
                 end
            end
        end
    end
end

% --- 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)
%h=uicontrol(handles.pushbutton2,'CurrentAxes');

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

% Hints: get(hObject,'String') returns contents of edit1 as text
%        str2double(get(hObject,'String')) returns contents of edit1 as a double


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

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



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

% Hints: get(hObject,'String') returns contents of edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double


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

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



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

% Hints: get(hObject,'String') returns contents of edit3 as text
%        str2double(get(hObject,'String')) returns contents of edit3 as a double


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

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


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