sampling.m

来自「Design for Butterworth Filter」· M 代码 · 共 31 行

M
31
字号
clc;
disp('1=Sin');
disp('2=Cos');
disp('3=Exp');
t=0:0.005:5;
n=0:50;
a=input('Enter the Choice ');
switch a<=4
    case a==1
        f=input('Signal Frequency ');
        fs=input('Sampling Frequency ');
        x=sin(2*3.14*f*t);
        y=sin(2*3.14*f*n/fs);
    case a==2
        f=input('Signal Frequency ');
        fs=input('Sampling Frequency ');
        x=cos(2*3.14*f*t);
        y=cos(2*3.14*f*2*n/fs);
    case a==3
        b=input('Enter the b Value ');
        x=b.^t;
        y=b.^n;
end
subplot(2,1,1);

plot(t,x);
 
subplot(2,1,2);
stem(n,y);

        

⌨️ 快捷键说明

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