function varargout = Visual_system(varargin)


%%%Dr. Ignacio Serrano-Pedraza 2018
%%%iserrano@ucm.es


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

% Last Modified by GUIDE v2.5 13-Mar-2018 12:06:50

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

% Choose default command line output for Visual_system
handles.output = hObject;
% Play_sound handles structure
guidata(hObject, handles);

Plot_figure(hObject, eventdata, handles)


function Plot_figure(hObject, eventdata, handles)
expt = getexpt(handles);
for i=1:255
    r(i)=i/255;
    g(i)=i/255;
    b(i)=i/255;
end

gray2=[r',g',b'];
colormap(gray2);
map=colormap;

degreesimagex=8;
degreesimagey=degreesimagex;
TAMX=512;
TAMY=512;
gx=degreesimagex/TAMX;%Degrees of visual angle in x direction
gy=degreesimagey/TAMY;%Degrees of visual angle in y direction

[x,y]=meshgrid(-degreesimagex/2:(degreesimagex/TAMX):((degreesimagex/2)-(degreesimagex/TAMX))...
    ,((degreesimagey/2)):-(degreesimagey/TAMY):-((degreesimagey/2)-(degreesimagey/TAMY)));


Angulo=0;
xx=x.*cosd(Angulo)+y.*sind(Angulo);
yy=-x.*sind(Angulo)+y.*cosd(Angulo);

fNu=(TAMX/degreesimagex)/2; %frecuencia de Nyquist en el eje u
fNv=(TAMY/degreesimagey)/2; %frecuencia de Nyquist en el eje v
fu=fNu*2/TAMX; %sampling rate in frequency en el eje u c/deg  c/gav otra opcion es fu=1/degreesimagex
fv=fNv*2/TAMY; %sampling rate in frequency en el eje v c/deg  c/gav otra opcion es fv=1/degreesimagey
[u,v]=meshgrid(-fNu:(2*fNu/TAMX):fNu-(2*fNu/TAMX),fNv:-(2*fNv/TAMY):-(fNv-(2*fNv/TAMY)));

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


axes(handles.Plot1);
cla;
loadimagenes_index = get(handles.loadimagenes, 'Value');

if (expt.radiobutton11==1 && expt.radiobutton12==1 && expt.radiobutton13==1 && expt.radiobutton14==1 && expt.radiobutton15==1 && expt.radiobutton16==1)
    set(handles.Allfreq1,'Value',1);
    set(handles.Allfreqoff1,'Value',0);
end
if (expt.radiobutton21==1 && expt.radiobutton22==1 && expt.radiobutton23==1 && expt.radiobutton24==1 && expt.radiobutton25==1 && expt.radiobutton26==1)
    set(handles.Allfreq2,'Value',1);
    set(handles.Allfreqoff2,'Value',0);
end
if (expt.radiobutton31==1 && expt.radiobutton32==1 && expt.radiobutton33==1 && expt.radiobutton34==1 && expt.radiobutton35==1 && expt.radiobutton36==1)
    set(handles.Allfreq3,'Value',1);
    set(handles.Allfreqoff3,'Value',0);
end
if (expt.radiobutton41==1 && expt.radiobutton42==1 && expt.radiobutton43==1 && expt.radiobutton44==1 && expt.radiobutton45==1 && expt.radiobutton46==1)
    set(handles.Allfreq4,'Value',1);
    set(handles.Allfreqoff4,'Value',0);
end
if (expt.radiobutton51==1 && expt.radiobutton52==1 && expt.radiobutton53==1 && expt.radiobutton54==1 && expt.radiobutton55==1 && expt.radiobutton56==1)
    set(handles.Allfreq5,'Value',1);
    set(handles.Allfreqoff5,'Value',0);
end
if (expt.radiobutton61==1 && expt.radiobutton62==1 && expt.radiobutton63==1 && expt.radiobutton64==1 && expt.radiobutton65==1 && expt.radiobutton66==1)
    set(handles.Allfreq6,'Value',1);
    set(handles.Allfreqoff6,'Value',0);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (expt.radiobutton11==0 && expt.radiobutton12==0 && expt.radiobutton13==0 && expt.radiobutton14==0 && expt.radiobutton15==0 && expt.radiobutton16==0)
    set(handles.Allfreq1,'Value',0);
    set(handles.Allfreqoff1,'Value',1);
end
if (expt.radiobutton21==0 && expt.radiobutton22==0 && expt.radiobutton23==0 && expt.radiobutton24==0 && expt.radiobutton25==0 && expt.radiobutton26==0)
    set(handles.Allfreq2,'Value',0);
    set(handles.Allfreqoff2,'Value',1);
end
if (expt.radiobutton31==0 && expt.radiobutton32==0 && expt.radiobutton33==0 && expt.radiobutton34==0 && expt.radiobutton35==0 && expt.radiobutton36==0)
    set(handles.Allfreq3,'Value',0);
    set(handles.Allfreqoff3,'Value',1);
end
if (expt.radiobutton41==0 && expt.radiobutton42==0 && expt.radiobutton43==0 && expt.radiobutton44==0 && expt.radiobutton45==0 && expt.radiobutton46==0)
    set(handles.Allfreq4,'Value',0);
    set(handles.Allfreqoff4,'Value',1);
end
if (expt.radiobutton51==0 && expt.radiobutton52==0 && expt.radiobutton53==0 && expt.radiobutton54==0 && expt.radiobutton55==0 && expt.radiobutton56==0)
    set(handles.Allfreq5,'Value',0);
    set(handles.Allfreqoff5,'Value',1);
end
if (expt.radiobutton61==0 && expt.radiobutton62==0 && expt.radiobutton63==0 && expt.radiobutton64==0 && expt.radiobutton65==0 && expt.radiobutton66==0)
    set(handles.Allfreq6,'Value',0);
    set(handles.Allfreqoff6,'Value',1);
end
if (expt.radiobutton11==1 && expt.radiobutton12==1 && expt.radiobutton13==1 && expt.radiobutton14==1 && expt.radiobutton15==1 && expt.radiobutton16==1)
    set(handles.Allfreq1,'Value',1);
    set(handles.Allfreqoff1,'Value',0);
end
if (expt.radiobutton21==1 && expt.radiobutton22==1 && expt.radiobutton23==1 && expt.radiobutton24==1 && expt.radiobutton25==1 && expt.radiobutton26==1)
    set(handles.Allfreq2,'Value',1);
    set(handles.Allfreqoff2,'Value',0);
end
if (expt.radiobutton31==1 && expt.radiobutton32==1 && expt.radiobutton33==1 && expt.radiobutton34==1 && expt.radiobutton35==1 && expt.radiobutton36==1)
    set(handles.Allfreq3,'Value',1);
    set(handles.Allfreqoff3,'Value',0);
end
if (expt.radiobutton41==1 && expt.radiobutton42==1 && expt.radiobutton43==1 && expt.radiobutton44==1 && expt.radiobutton45==1 && expt.radiobutton46==1)
    set(handles.Allfreq4,'Value',1);
    set(handles.Allfreqoff4,'Value',0);
end
if (expt.radiobutton51==1 && expt.radiobutton52==1 && expt.radiobutton53==1 && expt.radiobutton54==1 && expt.radiobutton55==1 && expt.radiobutton56==1)
    set(handles.Allfreq5,'Value',1);
    set(handles.Allfreqoff5,'Value',0);
end
if (expt.radiobutton61==1 && expt.radiobutton62==1 && expt.radiobutton63==1 && expt.radiobutton64==1 && expt.radiobutton65==1 && expt.radiobutton66==1)
    set(handles.Allfreq6,'Value',1);
    set(handles.Allfreqoff6,'Value',0);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (expt.radiobutton11==0 && expt.radiobutton12==0 && expt.radiobutton13==0 && expt.radiobutton14==0 && expt.radiobutton15==0 && expt.radiobutton16==0)
    set(handles.Allfreq1,'Value',0);
    set(handles.Allfreqoff1,'Value',1);
end
if (expt.radiobutton21==0 && expt.radiobutton22==0 && expt.radiobutton23==0 && expt.radiobutton24==0 && expt.radiobutton25==0 && expt.radiobutton26==0)
    set(handles.Allfreq2,'Value',0);
    set(handles.Allfreqoff2,'Value',1);
end
if (expt.radiobutton31==0 && expt.radiobutton32==0 && expt.radiobutton33==0 && expt.radiobutton34==0 && expt.radiobutton35==0 && expt.radiobutton36==0)
    set(handles.Allfreq3,'Value',0);
    set(handles.Allfreqoff3,'Value',1);
end
if (expt.radiobutton41==0 && expt.radiobutton42==0 && expt.radiobutton43==0 && expt.radiobutton44==0 && expt.radiobutton45==0 && expt.radiobutton46==0)
    set(handles.Allfreq4,'Value',0);
    set(handles.Allfreqoff4,'Value',1);
end
if (expt.radiobutton51==0 && expt.radiobutton52==0 && expt.radiobutton53==0 && expt.radiobutton54==0 && expt.radiobutton55==0 && expt.radiobutton56==0)
    set(handles.Allfreq5,'Value',0);
    set(handles.Allfreqoff5,'Value',1);
end
if (expt.radiobutton61==0 && expt.radiobutton62==0 && expt.radiobutton63==0 && expt.radiobutton64==0 && expt.radiobutton65==0 && expt.radiobutton66==0)
    set(handles.Allfreq6,'Value',0);
    set(handles.Allfreqoff6,'Value',1);
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


if (expt.radiobutton11==1 && expt.radiobutton21==1 && expt.radiobutton31==1 && expt.radiobutton41==1 && expt.radiobutton51==1 && expt.radiobutton61==1)
    set(handles.Allori1,'Value',1);
    set(handles.Allorioff1,'Value',0);
end
if (expt.radiobutton12==1 && expt.radiobutton22==1 && expt.radiobutton32==1 && expt.radiobutton42==1 && expt.radiobutton52==1 && expt.radiobutton62==1)
    set(handles.Allori2,'Value',1);
    set(handles.Allorioff2,'Value',0);
end
if (expt.radiobutton13==1 && expt.radiobutton23==1 && expt.radiobutton33==1 && expt.radiobutton43==1 && expt.radiobutton53==1 && expt.radiobutton63==1)
    set(handles.Allori3,'Value',1);
    set(handles.Allorioff3,'Value',0);
end
if (expt.radiobutton14==1 && expt.radiobutton24==1 && expt.radiobutton34==1 && expt.radiobutton44==1 && expt.radiobutton54==1 && expt.radiobutton64==1)
    set(handles.Allori4,'Value',1);
    set(handles.Allorioff4,'Value',0);
end
if (expt.radiobutton15==1 && expt.radiobutton25==1 && expt.radiobutton35==1 && expt.radiobutton45==1 && expt.radiobutton55==1 && expt.radiobutton65==1)
    set(handles.Allori5,'Value',1);
    set(handles.Allorioff5,'Value',0);
end
if (expt.radiobutton16==1 && expt.radiobutton26==1 && expt.radiobutton36==1 && expt.radiobutton46==1 && expt.radiobutton56==1 && expt.radiobutton66==1)
    set(handles.Allori6,'Value',1);
    set(handles.Allorioff6,'Value',0);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if (expt.radiobutton11==0 && expt.radiobutton21==0 && expt.radiobutton31==0 && expt.radiobutton41==0 && expt.radiobutton51==0 && expt.radiobutton61==0)
    set(handles.Allori1,'Value',0);
    set(handles.Allorioff1,'Value',1);
end
if (expt.radiobutton12==0 && expt.radiobutton22==0 && expt.radiobutton32==0 && expt.radiobutton42==0 && expt.radiobutton52==0 && expt.radiobutton62==0)
    set(handles.Allori2,'Value',0);
    set(handles.Allorioff2,'Value',1);
end
if (expt.radiobutton13==0 && expt.radiobutton23==0 && expt.radiobutton33==0 && expt.radiobutton43==0 && expt.radiobutton53==0 && expt.radiobutton63==0)
    set(handles.Allori3,'Value',0);
    set(handles.Allorioff3,'Value',1);
end
if (expt.radiobutton14==0 && expt.radiobutton24==0 && expt.radiobutton34==0 && expt.radiobutton44==0 && expt.radiobutton54==0 && expt.radiobutton64==0)
    set(handles.Allori4,'Value',0);
    set(handles.Allorioff4,'Value',1);
end
if (expt.radiobutton15==0 && expt.radiobutton25==0 && expt.radiobutton35==0 && expt.radiobutton45==0 && expt.radiobutton55==0 && expt.radiobutton65==0)
    set(handles.Allori5,'Value',0);
    set(handles.Allorioff5,'Value',1);
end
if (expt.radiobutton16==0 && expt.radiobutton26==0 && expt.radiobutton36==0 && expt.radiobutton46==0 && expt.radiobutton56==0 && expt.radiobutton66==0)
    set(handles.Allori6,'Value',0);
    set(handles.Allorioff6,'Value',1);
end


switch loadimagenes_index
    case 1
        imagen=double(imread('IMAGES/Arturo1.pcx','pcx'));
        
    case 2
        imagen=double(imread('IMAGES/Arturo1.pcx','pcx'));
    case 3
        imagen=double(imread('IMAGES/barbara.pcx','pcx'));
    case 4
        imagen=double(imread('IMAGES/boat.pcx','pcx'));
    case 5
        imagen=double(imread('IMAGES/Bush.pcx','pcx'));
    case 6
        imagen=double(imread('IMAGES/Cibeles.pcx','pcx'));
    case 7
        imagen=double(imread('IMAGES/Einstein_Marilyn.pcx','pcx'));
    case 8
        imagen=double(imread('IMAGES/Face.pcx','pcx'));
    case 9
        imagen=double(imread('IMAGES/fingerprint.pcx','pcx'));
    case 10
        imagen=double(imread('IMAGES/flinstones.pcx','pcx'));
    case 11
        imagen=double(imread('IMAGES/Helmholtz.pcx','pcx'));
    case 12
        imagen=double(imread('IMAGES/mullerlyer.pcx','pcx'));
    case 13
        imagen=double(imread('IMAGES/Noise_1_f.pcx','pcx'));
    case 14
        imagen=double(imread('IMAGES/Noise_gaussian.pcx','pcx'));
    case 15
        imagen=double(imread('IMAGES/Noise_uniform.pcx','pcx'));
    case 16
        imagen=double(imread('IMAGES/Obama.pcx','pcx'));
    case 17
        imagen=double(imread('IMAGES/pamela.pcx','pcx'));
    case 18
        imagen=128*ones(512,512);
        imagen([(TAMX/2-1)-5:(TAMX/2-1)+5],[(TAMX/2-1)-5:(TAMX/2-1)+5])=255;
    case 19
        imagen=double(imread('IMAGES/Tiger.pcx','pcx'));
    case 20
        imagen=double(imread('IMAGES/Uc3g.pcx','pcx'));
end

Image2D=imagen;
image(Image2D)
colormap(gray2);
map=colormap;
set(gca,'Fontsize',11);
set(gca,'LineWidth',1);
set(gca,'xcolor','k');
set(gca,'ycolor','k');
set(gca, 'xtickmode','manual');
set(gca, 'ytickmode','manual');
if degreesimagex>=8
    grados=round(linspace(-degreesimagex/2,degreesimagex/2,9));
    grados2=round(linspace(-degreesimagex/2,degreesimagex/2,9));
else
    
    grados=[-degreesimagex/2:degreesimagex/2];
    grados2=[-degreesimagex/2:degreesimagex/2];
    
end
gradosconv=(((grados/(degreesimagex/2))*(TAMX/4)+(TAMX/4))*2+1);
gradosconv(:,length(gradosconv))=TAMX;
set(gca,'xtick',gradosconv);
set(gca,'XTickLabel',grados,'Fontsize',10);
set(gca,'ytick',gradosconv);
set(gca,'yTickLabel',grados2,'Fontsize',10);
title('Image')
xlabel('Postition (degrees)','Fontsize',10)
ylabel('Postition (degrees)','Fontsize',10)
axis square


I=Image2D;
Lave=sum(sum(I.*gx*gy))./(degreesimagex*degreesimagey);
c=(I-Lave)./Lave;%Contrast function
FFTimagen=fftshift(fft2(c));
FFTmodulo_imagen=abs(FFTimagen);
FASEimagen_imagen=angle(FFTimagen);
MODULOimagen_imagen=log10(1+abs(FFTimagen));

axes(handles.Plot2);
cla;

if expt.logvaluesbutton==1
    FFTmoduloNORMALIZADO=((255*(MODULOimagen_imagen./max(max(abs(MODULOimagen_imagen))))));
else
    FFTmoduloNORMALIZADO=255*((abs(FFTimagen))./max(max((abs(FFTimagen)))));
end


imagen=FFTmoduloNORMALIZADO;
frecmax=(TAMX/degreesimagex)/2;
imagen=imagen;
image(imagen)
set(gca,'Fontsize',11);
set(gca,'LineWidth',2);
set(gca,'xcolor','k');
set(gca,'ycolor','k');
set(gca, 'xtickmode','manual');
set(gca, 'ytickmode','manual');
frecuencias=[-frecmax -frecmax/2 -frecmax/4  -frecmax/8 0 frecmax/8  frecmax/4 frecmax/2 frecmax];
frecuencias2=[frecmax frecmax/2 frecmax/4  frecmax/8 0 -frecmax/8  -frecmax/4 -frecmax/2 -frecmax];
frecuenciasconv=(((frecuencias/frecmax)*(TAMX/4)+(TAMX/4))*2+1);
frecuenciasconv(:,length(frecuenciasconv))=TAMX;
set(gca,'xtick',frecuenciasconv);
set(gca,'XTickLabel',frecuencias,'Fontsize',10)
set(gca,'ytick',frecuenciasconv);
set(gca,'yTickLabel',frecuencias2,'Fontsize',10)
title('2D Amplitude spectrum of image')
xlabel('Spatial frequency (c/deg)','Fontsize',10)
ylabel('Spatial frequency (c/deg)','Fontsize',10)
axis square

colormap(gray2)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CHANNELS%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

phase=0;%fase
BOCT=expt.freqbandwidth;
gradosABO=expt.oribandwidth*pi/180;
Sensor=0*ones(TAMX,TAMY);
n=0;
for i=1:36
    if (expt.radiobutton11==1 && i==1);Angulo=expt.Ori1;u1=expt.Freq1;m=1;n=n+1;gain=expt.gain1;end; if (expt.radiobutton11==0 && i==1);m=0;end
    if (expt.radiobutton12==1 && i==2);Angulo=expt.Ori1;u1=expt.Freq2;m=1;n=n+1;gain=expt.gain2;end; if (expt.radiobutton12==0 && i==2);m=0;end
    if (expt.radiobutton13==1 && i==3);Angulo=expt.Ori1;u1=expt.Freq3;m=1;n=n+1;gain=expt.gain3;end; if (expt.radiobutton13==0 && i==3);m=0;end
    if (expt.radiobutton14==1 && i==4);Angulo=expt.Ori1;u1=expt.Freq4;m=1;n=n+1;gain=expt.gain4;end; if (expt.radiobutton14==0 && i==4);m=0;end
    if (expt.radiobutton15==1 && i==5);Angulo=expt.Ori1;u1=expt.Freq5;m=1;n=n+1;gain=expt.gain5;end; if (expt.radiobutton15==0 && i==5);m=0;end
    if (expt.radiobutton16==1 && i==6);Angulo=expt.Ori1;u1=expt.Freq6;m=1;n=n+1;gain=expt.gain6;end; if (expt.radiobutton16==0 && i==6);m=0;end
    
    if (expt.radiobutton21==1 && i==7);Angulo=expt.Ori2;u1=expt.Freq1;m=1;n=n+1;gain=expt.gain1;end; if (expt.radiobutton21==0 && i==7);m=0;end
    if (expt.radiobutton22==1 && i==8);Angulo=expt.Ori2;u1=expt.Freq2;m=1;n=n+1;gain=expt.gain2;end; if (expt.radiobutton22==0 && i==8);m=0;end
    if (expt.radiobutton23==1 && i==9);Angulo=expt.Ori2;u1=expt.Freq3;m=1;n=n+1;gain=expt.gain3;end; if (expt.radiobutton23==0 && i==9);m=0;end
    if (expt.radiobutton24==1 && i==10);Angulo=expt.Ori2;u1=expt.Freq4;m=1;n=n+1;gain=expt.gain4;end; if (expt.radiobutton24==0 && i==10);m=0;end
    if (expt.radiobutton25==1 && i==11);Angulo=expt.Ori2;u1=expt.Freq5;m=1;n=n+1;gain=expt.gain5;end; if (expt.radiobutton25==0 && i==11);m=0;end
    if (expt.radiobutton26==1 && i==12);Angulo=expt.Ori2;u1=expt.Freq6;m=1;n=n+1;gain=expt.gain6;end; if (expt.radiobutton26==0 && i==12);m=0;end
    
    if (expt.radiobutton31==1 && i==13);Angulo=expt.Ori3;u1=expt.Freq1;m=1;n=n+1;gain=expt.gain1;end; if (expt.radiobutton31==0 && i==13);m=0;end
    if (expt.radiobutton32==1 && i==14);Angulo=expt.Ori3;u1=expt.Freq2;m=1;n=n+1;gain=expt.gain2;end; if (expt.radiobutton32==0 && i==14);m=0;end
    if (expt.radiobutton33==1 && i==15);Angulo=expt.Ori3;u1=expt.Freq3;m=1;n=n+1;gain=expt.gain3;end; if (expt.radiobutton33==0 && i==15);m=0;end
    if (expt.radiobutton34==1 && i==16);Angulo=expt.Ori3;u1=expt.Freq4;m=1;n=n+1;gain=expt.gain4;end; if (expt.radiobutton34==0 && i==16);m=0;end
    if (expt.radiobutton35==1 && i==17);Angulo=expt.Ori3;u1=expt.Freq5;m=1;n=n+1;gain=expt.gain5;end; if (expt.radiobutton35==0 && i==17);m=0;end
    if (expt.radiobutton36==1 && i==18);Angulo=expt.Ori3;u1=expt.Freq6;m=1;n=n+1;gain=expt.gain6;end; if (expt.radiobutton36==0 && i==18);m=0;end
    
    if (expt.radiobutton41==1 && i==19);Angulo=expt.Ori4;u1=expt.Freq1;m=1;n=n+1;gain=expt.gain1;end; if (expt.radiobutton41==0 && i==19);m=0;end
    if (expt.radiobutton42==1 && i==20);Angulo=expt.Ori4;u1=expt.Freq2;m=1;n=n+1;gain=expt.gain2;end; if (expt.radiobutton42==0 && i==20);m=0;end
    if (expt.radiobutton43==1 && i==21);Angulo=expt.Ori4;u1=expt.Freq3;m=1;n=n+1;gain=expt.gain3;end; if (expt.radiobutton43==0 && i==21);m=0;end
    if (expt.radiobutton44==1 && i==22);Angulo=expt.Ori4;u1=expt.Freq4;m=1;n=n+1;gain=expt.gain4;end; if (expt.radiobutton44==0 && i==22);m=0;end
    if (expt.radiobutton45==1 && i==23);Angulo=expt.Ori4;u1=expt.Freq5;m=1;n=n+1;gain=expt.gain5;end; if (expt.radiobutton45==0 && i==23);m=0;end
    if (expt.radiobutton46==1 && i==24);Angulo=expt.Ori4;u1=expt.Freq6;m=1;n=n+1;gain=expt.gain6;end; if (expt.radiobutton46==0 && i==24);m=0;end
    
    if (expt.radiobutton51==1 && i==25);Angulo=expt.Ori5;u1=expt.Freq1;m=1;n=n+1;gain=expt.gain1;end; if (expt.radiobutton51==0 && i==25);m=0;end
    if (expt.radiobutton52==1 && i==26);Angulo=expt.Ori5;u1=expt.Freq2;m=1;n=n+1;gain=expt.gain2;end; if (expt.radiobutton52==0 && i==26);m=0;end
    if (expt.radiobutton53==1 && i==27);Angulo=expt.Ori5;u1=expt.Freq3;m=1;n=n+1;gain=expt.gain3;end; if (expt.radiobutton53==0 && i==27);m=0;end
    if (expt.radiobutton54==1 && i==28);Angulo=expt.Ori5;u1=expt.Freq4;m=1;n=n+1;gain=expt.gain4;end; if (expt.radiobutton54==0 && i==28);m=0;end
    if (expt.radiobutton55==1 && i==29);Angulo=expt.Ori5;u1=expt.Freq5;m=1;n=n+1;gain=expt.gain5;end; if (expt.radiobutton55==0 && i==29);m=0;end
    if (expt.radiobutton56==1 && i==30);Angulo=expt.Ori5;u1=expt.Freq6;m=1;n=n+1;gain=expt.gain6;end; if (expt.radiobutton56==0 && i==30);m=0;end
    
    if (expt.radiobutton61==1 && i==31);Angulo=expt.Ori6;u1=expt.Freq1;m=1;n=n+1;gain=expt.gain1;end; if (expt.radiobutton61==0 && i==31);m=0;end
    if (expt.radiobutton62==1 && i==32);Angulo=expt.Ori6;u1=expt.Freq2;m=1;n=n+1;gain=expt.gain2;end; if (expt.radiobutton62==0 && i==32);m=0;end
    if (expt.radiobutton63==1 && i==33);Angulo=expt.Ori6;u1=expt.Freq3;m=1;n=n+1;gain=expt.gain3;end; if (expt.radiobutton63==0 && i==33);m=0;end
    if (expt.radiobutton64==1 && i==34);Angulo=expt.Ori6;u1=expt.Freq4;m=1;n=n+1;gain=expt.gain4;end; if (expt.radiobutton64==0 && i==34);m=0;end
    if (expt.radiobutton65==1 && i==35);Angulo=expt.Ori6;u1=expt.Freq5;m=1;n=n+1;gain=expt.gain5;end; if (expt.radiobutton65==0 && i==35);m=0;end
    if (expt.radiobutton66==1 && i==36);Angulo=expt.Ori6;u1=expt.Freq6;m=1;n=n+1;gain=expt.gain6;end; if (expt.radiobutton66==0 && i==36);m=0;end
    
    if m==1
        expt.SX=sqrt(log(2)).*(1+2.^BOCT)./(pi*sqrt(2).*u1.*(2.^BOCT-1));%%Serrano-Pedraza et al. (2007) JoV.
        expt.SY=sqrt(log(2))/(sqrt(2)*pi*u1*tan(gradosABO/2));%%Serrano-Pedraza et al. (2007) JoV.
        xx=x.*cosd(Angulo)+y.*sind(Angulo);
        yy=-x.*sind(Angulo)+y.*cosd(Angulo);
        Gaussiana2D=exp(-(xx).^2./(2*expt.SX^2) - (yy).^2./(2*expt.SY^2));
        Sensor=(gain*(cos(2*pi*u1*xx+phase).*Gaussiana2D)+Sensor);
        
    end
    
end
Sensor=Sensor/n;

axes(handles.Plot3);
cla;
Image2D=(127.5*(1+1*(Sensor./max(max(abs(Sensor))))));
image(Image2D)
colormap(gray2);
map=colormap;
set(gca,'Fontsize',11);
set(gca,'LineWidth',1);
set(gca,'xcolor','k');
set(gca,'ycolor','k');
set(gca, 'xtickmode','manual');
set(gca, 'ytickmode','manual');
if degreesimagex>=8
    grados=round(linspace(-degreesimagex/2,degreesimagex/2,9));
    grados2=round(linspace(-degreesimagex/2,degreesimagex/2,9));
else
    
    grados=[-degreesimagex/2:degreesimagex/2];
    grados2=[-degreesimagex/2:degreesimagex/2];
    
end
gradosconv=(((grados/(degreesimagex/2))*(TAMX/4)+(TAMX/4))*2+1);
gradosconv(:,length(gradosconv))=TAMX;
set(gca,'xtick',gradosconv);
set(gca,'XTickLabel',grados,'Fontsize',10);
set(gca,'ytick',gradosconv);
set(gca,'yTickLabel',grados2,'Fontsize',10);
title('PSF channels')
xlabel('Postition (degrees)','Fontsize',10)
ylabel('Postition (degrees)','Fontsize',10)
axis square



axes(handles.Plot4);
cla;

I=Image2D;
Lave=sum(sum(I.*gx*gy))./(degreesimagex*degreesimagey);
c=(I-Lave)./Lave;%Contrast function
FFTimagen=fftshift(fft2(c));
FFTmodulo=abs(FFTimagen);
FASEimagen=angle(FFTimagen);
MODULOimagen=log10(1+abs(FFTimagen));


if expt.logvaluesbutton==1
    FFTmoduloNORMALIZADO=((255*(MODULOimagen./max(max(abs(MODULOimagen))))));
else
    FFTmoduloNORMALIZADO=255*((abs(FFTimagen))./max(max((abs(FFTimagen)))));
end


imagen=FFTmoduloNORMALIZADO;
frecmax=(TAMX/degreesimagex)/2;
imagen=imagen;
image(imagen)
set(gca,'Fontsize',11);
set(gca,'LineWidth',2);
set(gca,'xcolor','k');
set(gca,'ycolor','k');
set(gca, 'xtickmode','manual');
set(gca, 'ytickmode','manual');
frecuencias=[-frecmax -frecmax/2 -frecmax/4  -frecmax/8 0 frecmax/8  frecmax/4 frecmax/2 frecmax];
frecuencias2=[frecmax frecmax/2 frecmax/4  frecmax/8 0 -frecmax/8  -frecmax/4 -frecmax/2 -frecmax];
frecuenciasconv=(((frecuencias/frecmax)*(TAMX/4)+(TAMX/4))*2+1);
frecuenciasconv(:,length(frecuenciasconv))=TAMX;
set(gca,'xtick',frecuenciasconv);
set(gca,'XTickLabel',frecuencias,'Fontsize',10)
set(gca,'ytick',frecuenciasconv);
set(gca,'yTickLabel',frecuencias2,'Fontsize',10)
title('MTF channels')
xlabel('Spatial frequency (c/deg)','Fontsize',10)
ylabel('Spatial frequency (c/deg)','Fontsize',10)
axis square

colormap(gray2)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



FFTimagen=fftshift(fft2(Sensor));
FFTmodulo_Sensor=abs(FFTimagen);
FASEimagen_Sensor=angle(FFTimagen);
MODULOimagen=log10(1+abs(FFTimagen));



REALPROD=fftshift(FFTmodulo_Sensor.*FFTmodulo_imagen.*cos(FASEimagen_imagen));
IMAGPROD=fftshift(FFTmodulo_Sensor.*FFTmodulo_imagen.*sin(FASEimagen_imagen));
RESULT=(REALPROD+IMAGPROD*sqrt(-1));
FINAL=ifft2(RESULT);
IMAGENFILTRADA=real(FINAL);
IMAGENFILTRADANORMALIZADA=(127.5*(1+1*(IMAGENFILTRADA./max(max(abs(IMAGENFILTRADA))))));%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I=IMAGENFILTRADANORMALIZADA;
Lave=sum(sum(I.*gx*gy))./(degreesimagex*degreesimagey);
c=(I-Lave)./Lave;%Contrast function
FFTimagen=fftshift(fft2(c));
FFTmodulo=abs(FFTimagen);
FASEimagen=angle(FFTimagen);
MODULOimagen=log10(1+abs(FFTimagen));


axes(handles.Plot5);
cla;
Image2D=IMAGENFILTRADANORMALIZADA;
image(Image2D)
colormap(gray2);
map=colormap;
set(gca,'Fontsize',11);
set(gca,'LineWidth',1);
set(gca,'xcolor','k');
set(gca,'ycolor','k');
set(gca, 'xtickmode','manual');
set(gca, 'ytickmode','manual');
if degreesimagex>=8
    grados=round(linspace(-degreesimagex/2,degreesimagex/2,9));
    grados2=round(linspace(-degreesimagex/2,degreesimagex/2,9));
else
    
    grados=[-degreesimagex/2:degreesimagex/2];
    grados2=[-degreesimagex/2:degreesimagex/2];
    
end
gradosconv=(((grados/(degreesimagex/2))*(TAMX/4)+(TAMX/4))*2+1);
gradosconv(:,length(gradosconv))=TAMX;
set(gca,'xtick',gradosconv);
set(gca,'XTickLabel',grados,'Fontsize',10);
set(gca,'ytick',gradosconv);
set(gca,'yTickLabel',grados2,'Fontsize',10);
title('Processed Image')
xlabel('Postition (degrees)','Fontsize',10)
ylabel('Postition (degrees)','Fontsize',10)
axis square


I=IMAGENFILTRADANORMALIZADA;
Lave=sum(sum(I.*gx*gy))./(degreesimagex*degreesimagey);
c=(I-Lave)./Lave;%Contrast function
FFTimagen=fftshift(fft2(c));
FFTmodulo=abs(FFTimagen);
FASEimagen=angle(FFTimagen);
MODULOimagen=log10(1+abs(FFTimagen));

axes(handles.Plot6);
cla;

if expt.logvaluesbutton==1
    FFTmoduloNORMALIZADO=((255*(MODULOimagen./max(max(abs(MODULOimagen))))));
else
    FFTmoduloNORMALIZADO=255*((abs(FFTimagen))./max(max((abs(FFTimagen)))));
end


imagen=FFTmoduloNORMALIZADO;
frecmax=(TAMX/degreesimagex)/2;
imagen=imagen;
image(imagen)
set(gca,'Fontsize',11);
set(gca,'LineWidth',2);
set(gca,'xcolor','k');
set(gca,'ycolor','k');
set(gca, 'xtickmode','manual');
set(gca, 'ytickmode','manual');
frecuencias=[-frecmax -frecmax/2 -frecmax/4  -frecmax/8 0 frecmax/8  frecmax/4 frecmax/2 frecmax];
frecuencias2=[frecmax frecmax/2 frecmax/4  frecmax/8 0 -frecmax/8  -frecmax/4 -frecmax/2 -frecmax];
frecuenciasconv=(((frecuencias/frecmax)*(TAMX/4)+(TAMX/4))*2+1);
frecuenciasconv(:,length(frecuenciasconv))=TAMX;
set(gca,'xtick',frecuenciasconv);
set(gca,'XTickLabel',frecuencias,'Fontsize',10)
set(gca,'ytick',frecuenciasconv);
set(gca,'yTickLabel',frecuencias2,'Fontsize',10)
title('2D Amplitude spectrum of processed image')
xlabel('Spatial frequency (c/deg)','Fontsize',10)
ylabel('Spatial frequency (c/deg)','Fontsize',10)
axis square

colormap(gray2)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%





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




% --------------------------------------------------------------------
function OpenMenuItem_Callback(hObject, eventdata, handles)
% hObject    handle to OpenMenuItem (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
file = uigetfile('*.fig');
if ~isequal(file, 0)
    open(file);
end


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

Plot_figure(hObject, eventdata, handles)

function expt = getexpt(handles)
% Reads off key data from GUI


freqbandwidth = get(handles.freqbandwidth,'string');
expt.freqbandwidth = str2double(freqbandwidth);
oribandwidth = get(handles.oribandwidth,'string');
expt.oribandwidth = str2double(oribandwidth);

gain1 = get(handles.gain1,'string');
expt.gain1 = str2double(gain1);
gain2 = get(handles.gain2,'string');
expt.gain2 = str2double(gain2);
gain3 = get(handles.gain3,'string');
expt.gain3 = str2double(gain3);
gain4 = get(handles.gain4,'string');
expt.gain4 = str2double(gain4);
gain5 = get(handles.gain5,'string');
expt.gain5 = str2double(gain5);
gain6 = get(handles.gain6,'string');
expt.gain6 = str2double(gain6);

Freq1 = get(handles.Freq1,'string');
expt.Freq1 = str2double(Freq1);
Freq2 = get(handles.Freq2,'string');
expt.Freq2 = str2double(Freq2);
Freq3 = get(handles.Freq3,'string');
expt.Freq3 = str2double(Freq3);
Freq4 = get(handles.Freq4,'string');
expt.Freq4 = str2double(Freq4);
Freq5 = get(handles.Freq5,'string');
expt.Freq5 = str2double(Freq5);
Freq6 = get(handles.Freq6,'string');
expt.Freq6 = str2double(Freq6);


Ori1 = get(handles.Ori1,'string');
expt.Ori1 = str2double(Ori1);
Ori2 = get(handles.Ori2,'string');
expt.Ori2 = str2double(Ori2);
Ori3 = get(handles.Ori3,'string');
expt.Ori3 = str2double(Ori3);
Ori4 = get(handles.Ori4,'string');
expt.Ori4 = str2double(Ori4);
Ori5 = get(handles.Ori5,'string');
expt.Ori5 = str2double(Ori5);
Ori6 = get(handles.Ori6,'string');
expt.Ori6 = str2double(Ori6);


expt.logvaluesbutton= get(handles.logvaluesbutton,'value');
expt.linearvaluesbutton= get(handles.linearvaluesbutton,'value');

expt.radiobutton11= get(handles.radiobutton11,'value');
expt.radiobutton12= get(handles.radiobutton12,'value');
expt.radiobutton13= get(handles.radiobutton13,'value');
expt.radiobutton14= get(handles.radiobutton14,'value');
expt.radiobutton15= get(handles.radiobutton15,'value');
expt.radiobutton16= get(handles.radiobutton16,'value');

expt.radiobutton21= get(handles.radiobutton21,'value');
expt.radiobutton22= get(handles.radiobutton22,'value');
expt.radiobutton23= get(handles.radiobutton23,'value');
expt.radiobutton24= get(handles.radiobutton24,'value');
expt.radiobutton25= get(handles.radiobutton25,'value');
expt.radiobutton26= get(handles.radiobutton26,'value');

expt.radiobutton31= get(handles.radiobutton31,'value');
expt.radiobutton32= get(handles.radiobutton32,'value');
expt.radiobutton33= get(handles.radiobutton33,'value');
expt.radiobutton34= get(handles.radiobutton34,'value');
expt.radiobutton35= get(handles.radiobutton35,'value');
expt.radiobutton36= get(handles.radiobutton36,'value');

expt.radiobutton41= get(handles.radiobutton41,'value');
expt.radiobutton42= get(handles.radiobutton42,'value');
expt.radiobutton43= get(handles.radiobutton43,'value');
expt.radiobutton44= get(handles.radiobutton44,'value');
expt.radiobutton45= get(handles.radiobutton45,'value');
expt.radiobutton46= get(handles.radiobutton46,'value');

expt.radiobutton51= get(handles.radiobutton51,'value');
expt.radiobutton52= get(handles.radiobutton52,'value');
expt.radiobutton53= get(handles.radiobutton53,'value');
expt.radiobutton54= get(handles.radiobutton54,'value');
expt.radiobutton55= get(handles.radiobutton55,'value');
expt.radiobutton56= get(handles.radiobutton56,'value');

expt.radiobutton61= get(handles.radiobutton61,'value');
expt.radiobutton62= get(handles.radiobutton62,'value');
expt.radiobutton63= get(handles.radiobutton63,'value');
expt.radiobutton64= get(handles.radiobutton64,'value');
expt.radiobutton65= get(handles.radiobutton65,'value');
expt.radiobutton66= get(handles.radiobutton66,'value');



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

Plot_figure(hObject, eventdata, handles)



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

Plot_figure(hObject, eventdata, handles)


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

Plot_figure(hObject, eventdata, handles)


% --- Executes during object creation, after setting all properties.
function Framerate_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Framerate (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 CloseMenuItem_Callback(hObject, eventdata, handles)
% hObject    handle to CloseMenuItem (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
selection = questdlg(['Close ' get(handles.axixX,'Name') '?'],...
    ['Close ' get(handles.axixX,'Name') '...'],...
    'Yes','No','Yes');
if strcmp(selection,'No')
    return;
end

delete(handles.axixX)
% --------------------------------------------------------------------
function PrintMenuItem_Callback(hObject, eventdata, handles)
% hObject    handle to PrintMenuItem (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
printdlg(handles.axixX)

% --------------------------------------------------------------------
function FileMenu_Callback(hObject, eventdata, handles)
% hObject    handle to FileMenu (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 Reset.
function Reset_Callback(hObject, eventdata, handles)
% hObject    handle to Reset (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


set(handles.Freq1,  'String', 0.5);
set(handles.Freq2,  'String', 1);
set(handles.Freq3,  'String', 2);
set(handles.Freq4,  'String', 4);
set(handles.Freq5,  'String', 8);
set(handles.Freq6,  'String', 16);

set(handles.Ori1,  'String', 0);
set(handles.Ori2,  'String', 30);
set(handles.Ori3,  'String', 60);
set(handles.Ori4,  'String', 90);
set(handles.Ori5,  'String', 120);
set(handles.Ori6,  'String', 150);

set(handles.gain1,  'String', 0.005);
set(handles.gain2,  'String', 0.02);
set(handles.gain3,  'String', 0.1);
set(handles.gain4,  'String', 0.4);
set(handles.gain5,  'String', 1.5);
set(handles.gain6,  'String', 7);


set(handles.freqbandwidth,  'String', 1);
set(handles.oribandwidth,  'String', 30);

set(handles.logvaluesbutton,'Value',1);
set(handles.linearvaluesbutton,'Value',0);

set(handles.radiobutton11,'Value',1);
set(handles.radiobutton12,'Value',0);
set(handles.radiobutton13,'Value',0);
set(handles.radiobutton14,'Value',0);
set(handles.radiobutton15,'Value',0);
set(handles.radiobutton16,'Value',0);

set(handles.radiobutton21,'Value',0);
set(handles.radiobutton22,'Value',0);
set(handles.radiobutton23,'Value',0);
set(handles.radiobutton24,'Value',0);
set(handles.radiobutton25,'Value',0);
set(handles.radiobutton26,'Value',0);


set(handles.radiobutton31,'Value',0);
set(handles.radiobutton32,'Value',0);
set(handles.radiobutton33,'Value',0);
set(handles.radiobutton34,'Value',0);
set(handles.radiobutton35,'Value',0);
set(handles.radiobutton36,'Value',0);

set(handles.radiobutton41,'Value',0);
set(handles.radiobutton42,'Value',0);
set(handles.radiobutton43,'Value',0);
set(handles.radiobutton44,'Value',0);
set(handles.radiobutton45,'Value',0);
set(handles.radiobutton46,'Value',0);

set(handles.radiobutton51,'Value',0);
set(handles.radiobutton52,'Value',0);
set(handles.radiobutton53,'Value',0);
set(handles.radiobutton54,'Value',0);
set(handles.radiobutton55,'Value',0);
set(handles.radiobutton56,'Value',0);

set(handles.radiobutton61,'Value',0);
set(handles.radiobutton62,'Value',0);
set(handles.radiobutton63,'Value',0);
set(handles.radiobutton64,'Value',0);
set(handles.radiobutton65,'Value',0);
set(handles.radiobutton66,'Value',0);

set(handles.Allfreq1,'Value',0);
set(handles.Allfreq2,'Value',0);
set(handles.Allfreq3,'Value',0);
set(handles.Allfreq4,'Value',0);
set(handles.Allfreq5,'Value',0);
set(handles.Allfreq6,'Value',0);

set(handles.Allfreqoff1,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allfreqoff6,'Value',0);

set(handles.Allori1,'Value',0);
set(handles.Allorioff1,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allorioff2,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allorioff3,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allorioff4,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allorioff5,'Value',0);


Plot_figure(hObject, eventdata, handles)




% --- Executes on button press in logvaluesbutton.
function logvaluesbutton_Callback(hObject, eventdata, handles)
% hObject    handle to logvaluesbutton (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 logvaluesbutton
set(handles.linearvaluesbutton,'Value',0);
set(handles.logvaluesbutton,'Value',1);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in linearvaluesbutton.
function linearvaluesbutton_Callback(hObject, eventdata, handles)
% hObject    handle to linearvaluesbutton (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.logvaluesbutton,'Value',0);
set(handles.linearvaluesbutton,'Value',1);
Plot_figure(hObject, eventdata, handles)
% Hint: get(hObject,'Value') returns toggle state of linearvaluesbutton



% --- Executes on selection change in loadimagenes.
function loadimagenes_Callback(hObject, eventdata, handles)
% hObject    handle to loadimagenes (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns loadimagenes contents as cell array
%        contents{get(hObject,'Value')} returns selected item from loadimagenes

Plot_figure(hObject, eventdata, handles)

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

% Hint: popupmenu 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 Bandpassbutton_noise.
function Bandpassbutton_noise_Callback(hObject, eventdata, handles)
% hObject    handle to Bandpassbutton_noise (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 Bandpassbutton_noise
set(handles.Highpassbutton_noise,'Value',0);
set(handles.Bandpassbutton_noise,'Value',1);
set(handles.Lowpassbutton_noise,'Value',0);
set(handles.Notchbutton_noise,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Highpassbutton_noise.
function Highpassbutton_noise_Callback(hObject, eventdata, handles)
% hObject    handle to Highpassbutton_noise (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 Highpassbutton_noise
set(handles.Highpassbutton_noise,'Value',1);
set(handles.Bandpassbutton_noise,'Value',0);
set(handles.Lowpassbutton_noise,'Value',0);
set(handles.Notchbutton_noise,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in FilterButterworth_noise.
function FilterButterworth_noise_Callback(hObject, eventdata, handles)
% hObject    handle to FilterButterworth_noise (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 FilterButterworth_noise
set(handles.Filterideal_noise,'Value',0);
set(handles.FilterButterworth_noise,'Value',1);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Filterideal_noise.
function Filterideal_noise_Callback(hObject, eventdata, handles)
% hObject    handle to Filterideal_noise (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 Filterideal_noise
set(handles.Filterideal_noise,'Value',1);
set(handles.FilterButterworth_noise,'Value',0);
Plot_figure(hObject, eventdata, handles)



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


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

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

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

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

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

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

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

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

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

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

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

% --- Executes during object creation, after setting all properties.
function Ori6_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Ori6 (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 radiobutton11.
function radiobutton11_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton11 (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 radiobutton11
set(handles.Allfreq1,'Value',0);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allorioff1,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton12.
function radiobutton12_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton12 (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 radiobutton12
set(handles.Allfreq1,'Value',0);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allorioff2,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton13.
function radiobutton13_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton13 (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 radiobutton13
set(handles.Allfreq1,'Value',0);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allorioff3,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton14.
function radiobutton14_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton14 (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 radiobutton14
set(handles.Allfreq1,'Value',0);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allorioff4,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton15.
function radiobutton15_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton15 (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 radiobutton15
set(handles.Allfreq1,'Value',0);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allorioff5,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton16.
function radiobutton16_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton16 (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 radiobutton16
set(handles.Allfreq1,'Value',0);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allori6,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton21.
function radiobutton21_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton21 (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 radiobutton21
set(handles.Allfreq2,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allorioff1,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton22.
function radiobutton22_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton22 (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 radiobutton22
set(handles.Allfreq2,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allorioff2,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton23.
function radiobutton23_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton23 (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 radiobutton23
set(handles.Allfreq2,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allorioff3,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton24.
function radiobutton24_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton24 (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 radiobutton24
set(handles.Allfreq2,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allorioff4,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton25.
function radiobutton25_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton25 (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 radiobutton25
set(handles.Allfreq2,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allorioff5,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton26.
function radiobutton26_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton26 (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 radiobutton26
set(handles.Allfreq2,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allori6,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton65.
function radiobutton29_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton65 (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 radiobutton65
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton66.
function radiobutton30_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton66 (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 radiobutton66
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton65.
function radiobutton31_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton65 (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 radiobutton65
set(handles.Allfreq3,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allorioff1,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton66.
function radiobutton32_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton66 (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 radiobutton66
set(handles.Allfreq3,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allorioff2,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton65.
function radiobutton33_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton65 (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 radiobutton65
set(handles.Allfreq3,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allorioff3,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton66.
function radiobutton34_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton66 (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 radiobutton66
set(handles.Allfreq3,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allorioff4,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton65.
function radiobutton35_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton65 (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 radiobutton65
set(handles.Allfreq3,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allorioff5,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton66.
function radiobutton36_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton66 (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 radiobutton66
set(handles.Allfreq3,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allori6,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)


function radiobutton37_Callback(hObject, eventdata, handles)

Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton54.
function radiobutton38_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton54 (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 radiobutton54
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton55.
function radiobutton39_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton55 (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 radiobutton55
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton56.
function radiobutton40_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton56 (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 radiobutton56
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton65.
function radiobutton41_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton65 (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 radiobutton65
set(handles.Allfreq4,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allorioff1,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton66.
function radiobutton42_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton66 (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 radiobutton66
set(handles.Allfreq4,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allorioff2,'Value',0);
Plot_figure(hObject, eventdata, handles)


function radiobutton43_Callback(hObject, eventdata, handles)

set(handles.Allfreq4,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allorioff3,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton54.
function radiobutton44_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton54 (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 radiobutton54
set(handles.Allfreq4,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allorioff4,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton55.
function radiobutton45_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton55 (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 radiobutton55
set(handles.Allfreq4,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allorioff5,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton56.
function radiobutton46_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton56 (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 radiobutton56
set(handles.Allfreq4,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allori6,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton61.
function radiobutton51_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton61 (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 radiobutton61
set(handles.Allfreq5,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allorioff1,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allfreq1.
function radiobutton52_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreq1 (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 Allfreq1
set(handles.Allfreq5,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allorioff2,'Value',0);
Plot_figure(hObject, eventdata, handles)

function radiobutton53_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreq1 (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 Allfreq1
set(handles.Allfreq5,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allorioff3,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in radiobutton64.
function radiobutton54_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton64 (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 radiobutton64
set(handles.Allfreq5,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allorioff4,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton65.
function radiobutton55_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton65 (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 radiobutton65
set(handles.Allfreq5,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allorioff5,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton66.
function radiobutton56_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton66 (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 radiobutton66
set(handles.Allfreq5,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allori6,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton61.
function radiobutton61_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton61 (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 radiobutton61
set(handles.Allfreq6,'Value',0);
set(handles.Allfreqoff6,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allorioff1,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton62.
function radiobutton62_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton62 (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 radiobutton62
set(handles.Allfreq6,'Value',0);
set(handles.Allfreqoff6,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allorioff2,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton63.
function radiobutton63_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton63 (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 radiobutton63
set(handles.Allfreq6,'Value',0);
set(handles.Allfreqoff6,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allorioff3,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton64.
function radiobutton64_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton64 (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 radiobutton64
set(handles.Allfreq6,'Value',0);
set(handles.Allfreqoff6,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allorioff4,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton65.
function radiobutton65_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton65 (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 radiobutton65
set(handles.Allfreq6,'Value',0);
set(handles.Allfreqoff6,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allorioff5,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in radiobutton66.
function radiobutton66_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton66 (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 radiobutton66
set(handles.Allfreq6,'Value',0);
set(handles.Allfreqoff6,'Value',0);
set(handles.Allori6,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)




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

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

% --- Executes during object creation, after setting all properties.
function oribandwidth_CreateFcn(hObject, eventdata, handles)
% hObject    handle to oribandwidth (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 text40_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Freq4 (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 gain1_Callback(hObject, eventdata, handles)
% hObject    handle to gain1 (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 gain1 as text
%        str2double(get(hObject,'String')) returns contents of gain1 as a double
Plot_figure(hObject, eventdata, handles)


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


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


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


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


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


% --- Executes during object creation, after setting all properties.
function gain6_CreateFcn(hObject, eventdata, handles)
% hObject    handle to gain6 (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 Allfreq1.
function Allfreq1_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreq1 (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 Allfreq1
set(handles.Allfreq1,'Value',1);
set(handles.Allfreqoff1,'Value',0);
set(handles.radiobutton11,'Value',1);
set(handles.radiobutton12,'Value',1);
set(handles.radiobutton13,'Value',1);
set(handles.radiobutton14,'Value',1);
set(handles.radiobutton15,'Value',1);
set(handles.radiobutton16,'Value',1);
set(handles.Allorioff1,'Value',0);
set(handles.Allorioff2,'Value',0);
set(handles.Allorioff3,'Value',0);
set(handles.Allorioff4,'Value',0);
set(handles.Allorioff5,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in Allfreq2.
function Allfreq2_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreq2 (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 Allfreq2
set(handles.Allfreq2,'Value',1);
set(handles.Allfreqoff2,'Value',0);
set(handles.radiobutton21,'Value',1);
set(handles.radiobutton22,'Value',1);
set(handles.radiobutton23,'Value',1);
set(handles.radiobutton24,'Value',1);
set(handles.radiobutton25,'Value',1);
set(handles.radiobutton26,'Value',1);
set(handles.Allorioff1,'Value',0);
set(handles.Allorioff2,'Value',0);
set(handles.Allorioff3,'Value',0);
set(handles.Allorioff4,'Value',0);
set(handles.Allorioff5,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in Allfreq3.
function Allfreq3_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreq3 (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 Allfreq3
set(handles.Allfreq3,'Value',1);
set(handles.Allfreqoff3,'Value',0);
set(handles.radiobutton31,'Value',1);
set(handles.radiobutton32,'Value',1);
set(handles.radiobutton33,'Value',1);
set(handles.radiobutton34,'Value',1);
set(handles.radiobutton35,'Value',1);
set(handles.radiobutton36,'Value',1);
set(handles.Allorioff1,'Value',0);
set(handles.Allorioff2,'Value',0);
set(handles.Allorioff3,'Value',0);
set(handles.Allorioff4,'Value',0);
set(handles.Allorioff5,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in Allfreq4.
function Allfreq4_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreq4 (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 Allfreq4
set(handles.Allfreq4,'Value',1);
set(handles.Allfreqoff4,'Value',0);
set(handles.radiobutton41,'Value',1);
set(handles.radiobutton42,'Value',1);
set(handles.radiobutton43,'Value',1);
set(handles.radiobutton44,'Value',1);
set(handles.radiobutton45,'Value',1);
set(handles.radiobutton46,'Value',1);
set(handles.Allorioff1,'Value',0);
set(handles.Allorioff2,'Value',0);
set(handles.Allorioff3,'Value',0);
set(handles.Allorioff4,'Value',0);
set(handles.Allorioff5,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in Allfreq5.
function Allfreq5_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreq5 (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 Allfreq5
set(handles.Allfreq5,'Value',1);
set(handles.Allfreqoff5,'Value',0);
set(handles.radiobutton51,'Value',1);
set(handles.radiobutton52,'Value',1);
set(handles.radiobutton53,'Value',1);
set(handles.radiobutton54,'Value',1);
set(handles.radiobutton55,'Value',1);
set(handles.radiobutton56,'Value',1);
set(handles.Allorioff1,'Value',0);
set(handles.Allorioff2,'Value',0);
set(handles.Allorioff3,'Value',0);
set(handles.Allorioff4,'Value',0);
set(handles.Allorioff5,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in Allfreq6.
function Allfreq6_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreq6 (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 Allfreq6
set(handles.Allfreq6,'Value',1);
set(handles.Allfreqoff6,'Value',0);
set(handles.radiobutton61,'Value',1);
set(handles.radiobutton62,'Value',1);
set(handles.radiobutton63,'Value',1);
set(handles.radiobutton64,'Value',1);
set(handles.radiobutton65,'Value',1);
set(handles.radiobutton66,'Value',1);
set(handles.Allorioff1,'Value',0);
set(handles.Allorioff2,'Value',0);
set(handles.Allorioff3,'Value',0);
set(handles.Allorioff4,'Value',0);
set(handles.Allorioff5,'Value',0);
set(handles.Allorioff6,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in Allfreqoff1.
function Allfreqoff1_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreqoff1 (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 Allfreqoff1
set(handles.Allfreq1,'Value',0);
set(handles.Allfreqoff1,'Value',1);
set(handles.radiobutton11,'Value',0);
set(handles.radiobutton12,'Value',0);
set(handles.radiobutton13,'Value',0);
set(handles.radiobutton14,'Value',0);
set(handles.radiobutton15,'Value',0);
set(handles.radiobutton16,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allori6,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in Allfreqoff2.
function Allfreqoff2_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreqoff2 (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 Allfreqoff2
set(handles.Allfreq2,'Value',0);
set(handles.Allfreqoff2,'Value',1);
set(handles.radiobutton21,'Value',0);
set(handles.radiobutton22,'Value',0);
set(handles.radiobutton23,'Value',0);
set(handles.radiobutton24,'Value',0);
set(handles.radiobutton25,'Value',0);
set(handles.radiobutton26,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allori6,'Value',0);
Plot_figure(hObject, eventdata, handles)




% --- Executes on button press in Allfreqoff3.
function Allfreqoff3_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreqoff3 (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 Allfreqoff3
set(handles.Allfreq3,'Value',0);
set(handles.Allfreqoff3,'Value',1);
set(handles.radiobutton31,'Value',0);
set(handles.radiobutton32,'Value',0);
set(handles.radiobutton33,'Value',0);
set(handles.radiobutton34,'Value',0);
set(handles.radiobutton35,'Value',0);
set(handles.radiobutton36,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allori6,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in Allfreqoff4.
function Allfreqoff4_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreqoff4 (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 Allfreqoff4
set(handles.Allfreq4,'Value',0);
set(handles.Allfreqoff4,'Value',1);
set(handles.radiobutton41,'Value',0);
set(handles.radiobutton42,'Value',0);
set(handles.radiobutton43,'Value',0);
set(handles.radiobutton44,'Value',0);
set(handles.radiobutton45,'Value',0);
set(handles.radiobutton46,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allori6,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in Allfreqoff5.
function Allfreqoff5_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreqoff5 (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 Allfreqoff5
set(handles.Allfreq5,'Value',0);
set(handles.Allfreqoff5,'Value',1);
set(handles.radiobutton51,'Value',0);
set(handles.radiobutton52,'Value',0);
set(handles.radiobutton53,'Value',0);
set(handles.radiobutton54,'Value',0);
set(handles.radiobutton55,'Value',0);
set(handles.radiobutton56,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allori6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allfreqoff6.
function Allfreqoff6_Callback(hObject, eventdata, handles)
% hObject    handle to Allfreqoff6 (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 Allfreqoff6
set(handles.Allfreq6,'Value',0);
set(handles.Allfreqoff6,'Value',1);
set(handles.radiobutton61,'Value',0);
set(handles.radiobutton62,'Value',0);
set(handles.radiobutton63,'Value',0);
set(handles.radiobutton64,'Value',0);
set(handles.radiobutton65,'Value',0);
set(handles.radiobutton66,'Value',0);
set(handles.Allori1,'Value',0);
set(handles.Allori2,'Value',0);
set(handles.Allori3,'Value',0);
set(handles.Allori4,'Value',0);
set(handles.Allori5,'Value',0);
set(handles.Allori6,'Value',0);
Plot_figure(hObject, eventdata, handles)


% --- Executes on button press in Allori1.
function Allori1_Callback(hObject, eventdata, handles)
% hObject    handle to Allori1 (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 Allori1
set(handles.Allori1,'Value',1);
set(handles.Allorioff1,'Value',0);
set(handles.radiobutton11,'Value',1);
set(handles.radiobutton21,'Value',1);
set(handles.radiobutton31,'Value',1);
set(handles.radiobutton41,'Value',1);
set(handles.radiobutton51,'Value',1);
set(handles.radiobutton61,'Value',1);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allfreqoff6,'Value',0);

Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allorioff1.
function Allorioff1_Callback(hObject, eventdata, handles)
% hObject    handle to Allorioff1 (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 Allorioff1
set(handles.Allori1,'Value',0);
set(handles.Allorioff1,'Value',1);
set(handles.radiobutton11,'Value',0);
set(handles.radiobutton21,'Value',0);
set(handles.radiobutton31,'Value',0);
set(handles.radiobutton41,'Value',0);
set(handles.radiobutton51,'Value',0);
set(handles.radiobutton61,'Value',0);
set(handles.Allfreq1,'Value',0);
set(handles.Allfreq2,'Value',0);
set(handles.Allfreq3,'Value',0);
set(handles.Allfreq4,'Value',0);
set(handles.Allfreq5,'Value',0);
set(handles.Allfreq6,'Value',0);

Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allori2.
function Allori2_Callback(hObject, eventdata, handles)
% hObject    handle to Allori2 (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 Allori2
set(handles.Allori2,'Value',1);
set(handles.Allorioff2,'Value',0);
set(handles.radiobutton12,'Value',1);
set(handles.radiobutton22,'Value',1);
set(handles.radiobutton32,'Value',1);
set(handles.radiobutton42,'Value',1);
set(handles.radiobutton52,'Value',1);
set(handles.radiobutton62,'Value',1);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allfreqoff6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allori3.
function Allori3_Callback(hObject, eventdata, handles)
% hObject    handle to Allori3 (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 Allori3
set(handles.Allori3,'Value',1);
set(handles.Allorioff3,'Value',0);
set(handles.radiobutton13,'Value',1);
set(handles.radiobutton23,'Value',1);
set(handles.radiobutton33,'Value',1);
set(handles.radiobutton43,'Value',1);
set(handles.radiobutton53,'Value',1);
set(handles.radiobutton63,'Value',1);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allfreqoff6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allori4.
function Allori4_Callback(hObject, eventdata, handles)
% hObject    handle to Allori4 (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 Allori4
set(handles.Allori4,'Value',1);
set(handles.Allorioff4,'Value',0);
set(handles.radiobutton14,'Value',1);
set(handles.radiobutton24,'Value',1);
set(handles.radiobutton34,'Value',1);
set(handles.radiobutton44,'Value',1);
set(handles.radiobutton54,'Value',1);
set(handles.radiobutton64,'Value',1);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allfreqoff6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allori5.
function Allori5_Callback(hObject, eventdata, handles)
% hObject    handle to Allori5 (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 Allori5
set(handles.Allori5,'Value',1);
set(handles.Allorioff5,'Value',0);
set(handles.radiobutton15,'Value',1);
set(handles.radiobutton25,'Value',1);
set(handles.radiobutton35,'Value',1);
set(handles.radiobutton45,'Value',1);
set(handles.radiobutton55,'Value',1);
set(handles.radiobutton65,'Value',1);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allfreqoff6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allori6.
function Allori6_Callback(hObject, eventdata, handles)
% hObject    handle to Allori6 (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 Allori6
set(handles.Allori6,'Value',1);
set(handles.Allorioff6,'Value',0);
set(handles.radiobutton16,'Value',1);
set(handles.radiobutton26,'Value',1);
set(handles.radiobutton36,'Value',1);
set(handles.radiobutton46,'Value',1);
set(handles.radiobutton56,'Value',1);
set(handles.radiobutton66,'Value',1);
set(handles.Allfreqoff1,'Value',0);
set(handles.Allfreqoff2,'Value',0);
set(handles.Allfreqoff3,'Value',0);
set(handles.Allfreqoff4,'Value',0);
set(handles.Allfreqoff5,'Value',0);
set(handles.Allfreqoff6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allorioff2.
function Allorioff2_Callback(hObject, eventdata, handles)
% hObject    handle to Allorioff2 (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 Allorioff2
set(handles.Allori2,'Value',0);
set(handles.Allorioff2,'Value',1);
set(handles.radiobutton12,'Value',0);
set(handles.radiobutton22,'Value',0);
set(handles.radiobutton32,'Value',0);
set(handles.radiobutton42,'Value',0);
set(handles.radiobutton52,'Value',0);
set(handles.radiobutton62,'Value',0);
set(handles.Allfreq1,'Value',0);
set(handles.Allfreq2,'Value',0);
set(handles.Allfreq3,'Value',0);
set(handles.Allfreq4,'Value',0);
set(handles.Allfreq5,'Value',0);
set(handles.Allfreq6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allorioff3.
function Allorioff3_Callback(hObject, eventdata, handles)
% hObject    handle to Allorioff3 (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 Allorioff3
set(handles.Allori3,'Value',0);
set(handles.Allorioff3,'Value',1);
set(handles.radiobutton13,'Value',0);
set(handles.radiobutton23,'Value',0);
set(handles.radiobutton33,'Value',0);
set(handles.radiobutton43,'Value',0);
set(handles.radiobutton53,'Value',0);
set(handles.radiobutton63,'Value',0);
set(handles.Allfreq1,'Value',0);
set(handles.Allfreq2,'Value',0);
set(handles.Allfreq3,'Value',0);
set(handles.Allfreq4,'Value',0);
set(handles.Allfreq5,'Value',0);
set(handles.Allfreq6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allorioff4.
function Allorioff4_Callback(hObject, eventdata, handles)
% hObject    handle to Allorioff4 (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 Allorioff4
set(handles.Allori4,'Value',0);
set(handles.Allorioff4,'Value',1);
set(handles.radiobutton14,'Value',0);
set(handles.radiobutton24,'Value',0);
set(handles.radiobutton34,'Value',0);
set(handles.radiobutton44,'Value',0);
set(handles.radiobutton54,'Value',0);
set(handles.radiobutton64,'Value',0);
set(handles.Allfreq1,'Value',0);
set(handles.Allfreq2,'Value',0);
set(handles.Allfreq3,'Value',0);
set(handles.Allfreq4,'Value',0);
set(handles.Allfreq5,'Value',0);
set(handles.Allfreq6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allorioff5.
function Allorioff5_Callback(hObject, eventdata, handles)
% hObject    handle to Allorioff5 (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 Allorioff5
set(handles.Allori5,'Value',0);
set(handles.Allorioff5,'Value',1);
set(handles.radiobutton15,'Value',0);
set(handles.radiobutton25,'Value',0);
set(handles.radiobutton35,'Value',0);
set(handles.radiobutton45,'Value',0);
set(handles.radiobutton55,'Value',0);
set(handles.radiobutton65,'Value',0);
set(handles.Allfreq1,'Value',0);
set(handles.Allfreq2,'Value',0);
set(handles.Allfreq3,'Value',0);
set(handles.Allfreq4,'Value',0);
set(handles.Allfreq5,'Value',0);
set(handles.Allfreq6,'Value',0);
Plot_figure(hObject, eventdata, handles)

% --- Executes on button press in Allorioff6.
function Allorioff6_Callback(hObject, eventdata, handles)
% hObject    handle to Allorioff6 (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 Allorioff6
set(handles.Allori6,'Value',0);
set(handles.Allorioff6,'Value',1);
set(handles.radiobutton16,'Value',0);
set(handles.radiobutton26,'Value',0);
set(handles.radiobutton36,'Value',0);
set(handles.radiobutton46,'Value',0);
set(handles.radiobutton56,'Value',0);
set(handles.radiobutton66,'Value',0);
set(handles.Allfreq1,'Value',0);
set(handles.Allfreq2,'Value',0);
set(handles.Allfreq3,'Value',0);
set(handles.Allfreq4,'Value',0);
set(handles.Allfreq5,'Value',0);
set(handles.Allfreq6,'Value',0);
Plot_figure(hObject, eventdata, handles)
