?? 同頻率振動合成程序模擬.m
字號:
% Samp1_2
N=200;dt=0.02;f1=3;f2=3; %采樣點數、間隔和兩個振動的頻率
n=0:N-1;t=n*dt; %定義時間離散值
x1=0.5*sin(2*pi*f1*t+1); %第一個振動
x2=0.3*sin(2*pi*f2*t+2.2); %第二個振動
subplot(3,1,1),plot(t,x1);ylim([-1 1]);
title('第一個振動') %第一個振動繪圖
subplot(3,1,2),plot(t,x2);ylim([-1 1]);
title('第二個振動') %第二個振動繪圖
subplot(3,1,3),plot(t,x1+x2);ylim([-1 1]);
title('合成振動') %合成振動繪圖
xlabel('時間/s')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -