?? tran.m
字號(hào):
%============================================================
% 程序名:tran.m
% 設(shè)f(t)=(t/4+1)[u(t+2)-u(t-2)]
% 本程序分別畫出f(t+t0)、f(t-t0)、f(-t)的波形,
% 同時(shí)還給出f(t)在時(shí)域中的壓縮(a>1)和擴(kuò)展(a<1)的f(at)的波形
%============================================================
syms t;
f=sym('(t/4+1)*(u(t+2)-u(t-2))');
t0=input('請(qǐng)輸入位移量t0=');
a1=input('請(qǐng)輸入壓縮系數(shù)a=');
a2=input('請(qǐng)輸入擴(kuò)展系數(shù)a=');
clf;
%畫f(t)=(t/4+1)[u(t+2)-u(t-2)]的波形
subplot(3,2,1);
ezplot(f,[-12,12]),grid on;disp('please push any key to continuous'),pause;
% 畫f(t)的左移波形
y1=subs(f,t,t+t0);
subplot(3,2,3);
ezplot(y1,[-12,12]),grid on
text(5,1.2,'信號(hào)左移');disp('please push any key to continuous'),pause;
%畫f(t)的右移波形
y2=subs(f,t,t-t0);
subplot(3,2,5);
ezplot(y2,[-12,12]),grid on;
text(-5,1.2,'信號(hào)右移');disp('please push any key to continuous'),pause;
%畫f(t)的反褶波形
y3=subs(f,t,-t);
subplot(3,2,2);
ezplot(y3,[-12,12]),grid on;
text(5,1.2,'信號(hào)反褶');disp('please push any key to continuous'),pause;
%畫f(2t)的波形---波形壓縮
y5=subs(f,t,a1*t);
subplot(3,2,4);
ezplot(y5,[-12,12]),grid on;
text(5,1.2,'信號(hào)壓縮');disp('please push any key to continuous'),pause;
%畫f(0.5t)的波形---波形擴(kuò)展
y6=subs(f,t,a2*t);
subplot(3,2,6);
ezplot(y6,[-12,12]),grid on;
text(5,1.2,'信號(hào)擴(kuò)展');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -