📄 sampling.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -