?? 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 + -