?? demotwo.m
字號:
%% Plots of Different Signals
%% Continuous Time Sinusoid
% $$x(t) = cos(2\pi ft) ,f=1,2 $$
t = [0:0.01:2];
x1 = cos(2*pi*t);
x2 = cos(2*pi*2*t);
x3 = t.*cos(2*pi*3*t);
x4 = cos(2*pi*4*t.*t);
%figure(1)
subplot(411); plot(t,x1);
title('Sinusoide of 1 Hz');xlabel('t')
subplot(412); plot(t,x2);
title('Sinusoid of 2 Hz');xlabel('t')
subplot(413); plot(t,x3);
title('Growing Sinusoid');xlabel('t')
subplot(414); plot(t,x4);
title('Sinusoid of Swept Frequency');xlabel('t')
%%
% $$x(t) = sin(t)u(t)-sin(t)u(t-2\pi)$$
t = [-2*pi:0.01:4*pi];
x = sin(t).*(u(t)-u(t-2*pi));
clf
%figure(2)
plot(t,x)
axis([-2*pi 4*pi -1 1])
%% Plot of Discrete Complex Exponential
% $$x[n] = e^{(-0.1+0.3 i)n} $$
n = [-10:1:10]; alpha = -0.1+0.3j;
x = exp(alpha*n);
%%
clf
%figure(3);
subplot(2,2,1); stem(n,real(x));
title('real part');xlabel('n')
subplot(2,2,2); stem(n,imag(x));
title('imaginary part');xlabel('n')
subplot(2,2,3); stem(n,abs(x));
title('magnitude part');xlabel('n')
subplot(2,2,4); stem(n,(180/pi)*angle(x));
title('phase part');xlabel('n')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -