📄 不同频率振动合成程序模拟.m
字号:
%Samp1_3
N=200;dt=0.02;f1=1;f2=9; %采样点数、间隔和两个振动的频率
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);
title('第一个振动') %第一个振动绘图
subplot(3,1,2),plot(t,x2);
title('第二个振动') %第二个振动绘图
subplot(3,1,3),plot(t,x1+x2);
title('合成振动') %合成振动绘图
xlabel('时间/s')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -