⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p411.asv

📁 matlab的gui设计程序,有关<信号与系统>课程的辅助教学设计
💻 ASV
字号:
function varargout = p411(varargin)
% P411 M-file for p411.fig
%      P411, by itself, creates a new P411 or raises the existing
%      singleton*.
%
%      H = P411 returns the handle to a new P411 or the handle to
%      the existing singleton*.
%
%      P411('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in P411.M with the given input arguments.
%
%      P411('Property','Value',...) creates a new P411 or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before p411_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to p411_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 p411

% Last Modified by GUIDE v2.5 30-May-2005 20:38:59
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @p411_OpeningFcn, ...
                   'gui_OutputFcn',  @p411_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin & isstr(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 p411 is made visible.
function p411_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 p411 (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = p411_OutputFcn(hObject, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton1 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)axes(handles.axes1) % Select the proper axes
%Buterworth analog lowpss filter prototype
n = 0:0.01:2;
for i = 1:4
    switch i
    case 1
        N = 2;
    case 2
        N = 5;
    case 3
        N = 10;
    case 4
        N = 20;
    end
    [z,p,k] = buttap(N);
    [b,a] = zp2tf(z,p,k);
    [H,w] = freqs(b,a,n);
    magH2 = (abs(H)).^2;
    hold on
    plot(w,magH2);
    axis([0 2 0 1]);
end
xlabel('w/wc');
ylabel('|H(jw)|^2');
title('巴特沃斯低通滤波器平方幅频响应曲线');
grid on% --- Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton2 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)p411
%Chebyshev type I analog lowpass filter prototype
n = 0:0.01:2;
for i = 1:4
    switch i
    case 1
        N = 2;
    case 2
        N = 4;
    case 3
        N = 6;
    case 4
        N = 8;
    end
    Rp = 1;
    [z,p,k] = cheb1ap(N,Rp);
    [b,a] = zp2tf(z,p,k);
    [H,w] = freqs(b,a,n);
    magH2 = (abs(H)).^2;
    %Output
    posplot = ['22' num2str(i)];
    subplot(posplot)
    plot(w,magH2);
    axis([0 2 0 1]);
    xlabel('w/wc');
    ylabel('切比雪夫|H(jw)|^2');
    title(['N='num2str(N));
    grid
end
% --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton3 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton4 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton5 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -