Code covered by the BSD License  

Highlights from
tipos de graficas

image thumbnail

tipos de graficas

by

 

muestra tipos de graficas

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

% Last Modified by GUIDE v2.5 08-Feb-2013 07:56:05

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

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = graficas_OutputFcn(hObject, eventdata, handles) 


% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on selection change in tipo1.
function tipo1_Callback(hObject, eventdata, handles)

% hObject    handle to tipo1 (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 tipo1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from tipo1


% --- Executes during object creation, after setting all properties.
function tipo1_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');    
end


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


% --- Executes on button press in graficar.
function graficar_Callback(hObject, eventdata, handles)

c=get(handles.cuadrada,'Value')
d=get(handles.sierra,'Value')
s=get(handles.senoidal,'Value')

if c==1
    
    try
        Am=eval(get(handles.amplitud,'String'));
        Fr=eval(get(handles.frecuencia,'String'));
        Cl=eval(get(handles.ciclo,'String'));

        if Am>5000
            errordlg('La Amplitud no puede debe ser mayor a 5000','ERROR');
        
        else
            
            if Fr<=0 | Fr>5000 
                errordlg('La frecuencia debe ser mayor a 0 y menor a 5000','ERROR');
            else
                if Cl<0 | Cl>100 
                    errordlg('El ciclo de trabajo debe ser de 0 a 100','ERROR');
                else
                    try
                        
                        W= 2*pi*Fr;
                        T= 1/Fr; 
                        %Fa=0.5;
                        t=0:0.001:5*T;
                        y=Am+(Am*square(W*t,Cl));
                        axes(handles.grafica1)
                        plot(t,y);
                        axis([0 5*T -2 (Am*2)+2]);

                        espe=abs(fft(y))
                        axes(handles.espectro)
                        %plot(espe);
                        bar(espe);
                        axis([-20 (5000*T)+50 -10 (Cl*100)+1000]);
                        zoom on;
                        
                    catch
                        errordlg('Error de ejecucion','ERROR');
                    end
                end
            end
        end
    
    catch
        errordlg('Verifique los datos','ERROR');
    end

else

    if d==1
        
        try
            Am=eval(get(handles.amplitud2,'String'));
            Fr=eval(get(handles.frecuencia2,'String'));
            
            if Am>5000
                errordlg('La Amplitud no puede debe ser mayor a 5000','ERROR');
                
            else
                if Fr<=0 | Fr>5000 
                    errordlg('La frecuencia debe ser mayor a 0 y menor a 5000','ERROR');
                else
                    try
                        W= 2*pi*Fr;
                        T= 1/Fr; 
                        %Fa=1;
                        t=0:0.001:5*T;
                        y=Am+(Am* sawtooth(W*t));
                        axes(handles.grafica1)
                        plot(t,y);
                        axis([0 5*T -2 (Am*2)+2]);

                        espe=abs(fft(y))
                        axes(handles.espectro)
                        %plot(espe);
                        bar(espe);
                        axis([-20 (5000*T)+10 -10 (50000*T)+10])
                        zoom on;
                    catch
                        errordlg('Error de ejecucion','ERROR');
                    end
                end
            end
        catch
            errordlg('Verifique los datos','ERROR');
        end
    else

        if s==1
            
            try
                
                Am1=eval(get(handles.am1,'String'));
                Am2=eval(get(handles.am2,'String'));
                Am3=eval(get(handles.am3,'String'));
                
                if Am1>5000|Am2>5000|Am3>5000
                    errordlg('La Amplitud no puede debe ser mayor a 5000','ERROR');
                
                else
                
                    Fr1=eval(get(handles.fr1,'String'));
                    Fr2=eval(get(handles.fr2,'String'));
                    Fr3=eval(get(handles.fr3,'String'));
                    
                    if Fr1<=0 | Fr1>5000 | Fr2<=0 | Fr2>5000 | Fr3<=0 | Fr3>5000 
                        errordlg('La frecuencia debe ser mayor a 0 y menor a 5000','ERROR');
                    else
                    
                        Fa1=eval(get(handles.fa1,'String'));
                        Fa2=eval(get(handles.fa2,'String'));
                        Fa3=eval(get(handles.fa3,'String'));
                        
                        if Fa1<0 | Fa1>5000 | Fa2<0 | Fa2>5000 | Fa3<0 | Fa3>5000
                            errordlg('La fase debe ser mayor o igual a 0 y menor a 5000','ERROR');
                        else
                        
                            Tp1=get(handles.tipo1,'String');
                            Tp2=get(handles.tipo2,'String');
                            Tp3=get(handles.tipo3,'String');
                            
                            try
                                W1= 2*pi*Fr1;
                                W2= 2*pi*Fr2;
                                W3= 2*pi*Fr3;
                                T= 1/Fr1; 
                                t=0:0.001:5*T;

                                if Tp1=='sin'
                                    S1= Am1+(Am1*sin(W1*t+Fa1));
                                else
                                    if Tp1=='cos'
                                        S1= Am1+(Am1*cos(W1*t+Fa1));
                                    else
                                        errordlg('En la segunda caja de texto solo puede ser sin o cos','ERROR');
                                    end
                                end

                                if Tp2=='sin'
                                    S2= Am2+(Am2*sin(W2*t+Fa2));
                                else
                                    if Tp2=='cos'
                                        S2= Am2+(Am2*cos(W2*t+Fa2));
                                    else
                                        errordlg('En la segunda caja de texto solo puede ser sin o cos','ERROR');
                                    end
                                end

                                if Tp3=='sin'
                                    S3= Am3+(Am3*sin(W3*t+Fa3));
                                else
                                    if Tp3 =='cos'
                                        S3= Am3+(Am3*cos(W3*t+Fa3));
                                    else
                                        errordlg('En la segunda caja de texto solo puede ser sin o cos','ERROR');
                                    end
                                end

                                axes(handles.grafica1)
                                plot(t,S1,t,S2,t,S3);

                                y=S1+S2+S3;
                                axes(handles.espectro)
                                plot(t,y);
                                %axis([0 5*T -2 (Am*2)+2]);

                                espe=abs(fft(y))
                                axes(handles.grafica2)
                                %plot(espe);
                                bar(espe)
                                %axis([-20 (5000*T)+50 -10 (Cl*100)+1000]);
                                zoom on;
                            catch
                                errordlg('Verifique los datos','ERROR');
                            end
                        end
                    end     
                end
            
            catch
                errordlg('Verifique los datos','ERROR');
            end
            
        else 
            errordlg('Seleccione una de las tres graficas','ERROR');
        end
    end
end







    


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


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



function amplitud_Callback(hObject, eventdata, handles)
set(handles.frecuencia,'Enable','on');
% hObject    handle to amplitud (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 amplitud as text
%        str2double(get(hObject,'String')) returns contents of amplitud as a double


% --- Executes during object creation, after setting all properties.
function amplitud_CreateFcn(hObject, eventdata, handles)
% hObject    handle to amplitud (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 frecuencia_Callback(hObject, eventdata, handles)
set(handles.ciclo,'Enable','on');
% hObject    handle to frecuencia (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 frecuencia as text
%        str2double(get(hObject,'String')) returns contents of frecuencia as a double


% --- Executes during object creation, after setting all properties.
function frecuencia_CreateFcn(hObject, eventdata, handles)
% hObject    handle to frecuencia (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 ciclo_Callback(hObject, eventdata, handles)
set(handles.graficar,'Visible','on');
% hObject    handle to ciclo (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 ciclo as text
%        str2double(get(hObject,'String')) returns contents of ciclo as a double


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


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


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


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


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


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


% --- Executes during object creation, after setting all properties.
function am2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to am2 (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 selection change in tipo2.
function tipo2_Callback(hObject, eventdata, handles)
% hObject    handle to tipo2 (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 tipo2 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from tipo2


% --- Executes during object creation, after setting all properties.
function tipo2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to tipo2 (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



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


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


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


% --- Executes during object creation, after setting all properties.
function am3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to am3 (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 selection change in tipo3.
function tipo3_Callback(hObject, eventdata, handles)
% hObject    handle to tipo3 (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 tipo3 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from tipo3


% --- Executes during object creation, after setting all properties.
function tipo3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to tipo3 (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



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


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


% --- Executes during object creation, after setting all properties.
function fa3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to fa3 (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 cuadrada_CreateFcn(hObject, eventdata, handles)

% hObject    handle to cuadrada (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called


% --- Executes when selected object is changed in uipanel1.
function uipanel1_SelectionChangeFcn(hObject, eventdata, handles)

c=get(handles.cuadrada,'Value')
d=get(handles.sierra,'Value')
s=get(handles.senoidal,'Value')

if c==1

set(handles.frecuencia,'String','');
set(handles.amplitud,'String','');
set(handles.ciclo,'String','');

set(handles.panel1,'Visible','on'); 
set(handles.panel2,'Visible','off');
set(handles.panel3,'Visible','off');
set(handles.grafica2,'Visible','off');

end 

if d==1

set(handles.frecuencia2,'String','');
set(handles.amplitud2,'String','');
    
set(handles.panel1,'Visible','off'); 
set(handles.panel2,'Visible','on');
set(handles.panel3,'Visible','off');
set(handles.grafica2,'Visible','off');

end

if s==1
    
set(handles.am1,'String','');
set(handles.am2,'String','');
set(handles.am3,'String','');
set(handles.fr1,'String','');
set(handles.fr2,'String','');
set(handles.fr3,'String','');
set(handles.fa1,'String','');
set(handles.fa2,'String','');
set(handles.fa3,'String','');
    
set(handles.panel1,'Visible','off'); 
set(handles.panel2,'Visible','off');
set(handles.panel3,'Visible','on');
set(handles.grafica2,'Visible','on');


end
% hObject    handle to the selected object in uipanel1 
% eventdata  structure with the following fields (see UIBUTTONGROUP)
%	EventName: string 'SelectionChanged' (read only)
%	OldValue: handle of the previously selected object or empty if none was selected
%	NewValue: handle of the currently selected object
% handles    structure with handles and user data (see GUIDATA)



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


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


% --- Executes during object creation, after setting all properties.
function edit27_CreateFcn(hObject, eventdata, handles)
% hObject    handle to am1 (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 selection change in tipo1.
function popupmenu4_Callback(hObject, eventdata, handles)
% hObject    handle to tipo1 (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 tipo1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from tipo1


% --- Executes during object creation, after setting all properties.
function popupmenu4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to tipo1 (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



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


% --- Executes during object creation, after setting all properties.
function edit29_CreateFcn(hObject, eventdata, handles)
% hObject    handle to fr1 (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 selection change in tipo2.
function popupmenu23_Callback(hObject, eventdata, handles)
% hObject    handle to tipo2 (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 tipo2 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from tipo2


% --- Executes during object creation, after setting all properties.
function popupmenu23_CreateFcn(hObject, eventdata, handles)
% hObject    handle to tipo2 (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 selection change in tipo3.
function popupmenu24_Callback(hObject, eventdata, handles)
% hObject    handle to tipo3 (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 tipo3 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from tipo3


% --- Executes during object creation, after setting all properties.
function popupmenu24_CreateFcn(hObject, eventdata, handles)
% hObject    handle to tipo3 (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

Contact us