📄 calc.m
字号:
%=====================================================
% 信号的时域运算 程序名:calc.m
% 本程序给出两个信号之间的乘法,并画出相应的波形图
% 设两个信号分别为:f1(t)=sin(pi*t),f2(t)=sin(8*pi*t)
%=====================================================
clear;
t=-5:0.01:5;
w1=input('w1=');
w2=input('w2=');
f1=sin(w1*t);
clf;
subplot(2,2,1);
plot(t,f1);
axis([-5,5,-1.2,1.2]);
grid on;
title('f1=sin(w1*t)')
f2=sin(w2*t);
subplot(2,2,2);
plot(t,f2);
axis([-5,5,-1.2,1.2]);
grid on;
title('f2=sin(w2*t)')
f3=f1.*f2;
subplot(2,2,3);
plot(t,f3);
axis([-5,5,-1.2,1.2]);
grid on;
title('f3=f1*f2');
f4=f1+f2;
subplot(2,2,4);
plot(t,f4);
axis([-5,5,-1.2,1.2]);
grid on;
title('f3=f1+f2');
%====================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -