?? calc.m
字號:
%=====================================================
% 信號的時域運(yùn)算 程序名:calc.m
% 本程序給出兩個信號之間的乘法,并畫出相應(yīng)的波形圖
% 設(shè)兩個信號分別為: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');
%====================================================
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -