|
- clc
- clear
- N=5120; T=10; t=linspace(0,T,N);
- m1=17.248; m2=34.496; m3=17.248;
- m11=46.347; m22=54.238; m33=89.096;
- w1=57.158;w2=131.05;w3=157.92;
- i=1; %% new %%
- for w=40:0.1:170
- q1=2.9973*(500*sin(28579/500*t)*w-28579*sin(w*t))/(500*w-28579)/(500*w+28579);
- q2=0.05032*(20*sin(2621/20*t)*w-2621*sin(w*t))/(20*w-2621)/(20*w+2621);
- q3=0.0100*(25*sin(3948/25*t)*w-3948*sin(w*t))/(25*w-3948)/(25*w+3948);
- x=0.294*q1+q2+0.775*q3; y=20*log10(abs(x));
- z(i)=max(y); i=i+1; %% new %%
- end
- %%%%%%到此,出来是散点图
- %%%添加如下代码
- w=(40:0.1:170 )'; z=z'; %% new %%
- p=polyfit(w,z,2);
- w1=40:5:170;
- z1=polyval(p,w1);
- plot(w,z,'r'); hold on;
- plot(w1,z1,'o')
- legend('原始数据','拟合数据')
复制代码
不知道为何你的不显示拟合曲线? |
评分
-
1
查看全部评分
-
|