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

📄 demotwo.m

📁 Self devrloped Demos for beginners of Matlab generate HTML report and enjoy
💻 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 + -