![]() |
这个有点小错~可是却不知道怎么改,麻烦高手
clear;clc;
x=[-180 -150 -120 -90 -60 -30 0 30 60 90 120 150 180 210 240 270 300 330]; y=[0 0.02 0.03 0.05 0.07 0.1 0.15 0.20 0.26 0.30 0.28 0.25 0.20 0.16 0.1 0.05 0.03 0.01]; myfunc=inline('-2*pi*beta(1)*0.33/31684(x*exp(-pi*x*x/31684)-(x-204.08)*exp(-pi*(x-204.08)*(x-204.08)/31684))','beta','x'); beta=nlinfit(x,y,myfunc,[0.2]); b=beta(1) %test the model xx=min(x):max(x); yy=-2*pi*b*0.33/31684(x*exp(-pi*x*x/31684)-(x-204.08)*exp(-pi*(x-204.08)*(x-204.08)/31684)); plot(x,y,'o',x,yy,'r') |
回复: 这个有点小错~可是却不知道怎么改,麻烦高手
clear;clc;
x=[-180 -150 -120 -90 -60 -30 0 30 60 90 120 150 180 210 240 270 300 330]; y=[0 0.02 0.03 0.05 0.07 0.1 0.15 0.20 0.26 0.30 0.28 0.25 0.20 0.16 0.1 0.05 0.03 0.01]; myfunc=inline('-2*pi*beta*0.33/31684*(x.*exp(-pi*x.*x/31684)-(x-204.08).*exp(-pi*(x-204.08).*(x-204.08)/31684))','beta','x'); beta=nlinfit(x,y,myfunc,0.2); b=beta %test the model xx=min(x):max(x); yy=-2*pi*b*0.33/31684*(x.*exp(-pi*x.*x/31684)-(x-204.08).*exp(-pi*(x-204.08).*(x-204.08)/31684)); plot(x,y,'o',x,yy,'r') inline的函数应和yy的一样,且 要注意矩阵相应项相乘时应加‘.’,望有帮助!!! |
所有时间均为北京时间。现在的时间是 04:25。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.