主题:如何拟合如下形式的函数
我想拟合形如y=a0+a1*x+a2*x^-1+a3*x^-2+a4*x^-3的函数
应该用什么命令
这里是我用nlinfit的非线性回归做得,不过出不来参数
>>abstand=[0 5 10 15 20 25 30 35 40 50 60 80 100] %自变量
>>Sensorwerte=[1020 860 500 325 240 190 155 132 120 106 94 84 80] %函数值
>>rule=inline('coefficent(1)+coefficent(2)*abstand+coefficent(3)*abstand.^(-1)+coefficent(4)*abstand.^(-2)+coefficent(5)*abstand.^(-3)','coefficent','abstand')
>>coefficent=nlinfit(abstand,Sensorwerte,rule,[1 1 1 1 1])
应该用什么命令
这里是我用nlinfit的非线性回归做得,不过出不来参数
>>abstand=[0 5 10 15 20 25 30 35 40 50 60 80 100] %自变量
>>Sensorwerte=[1020 860 500 325 240 190 155 132 120 106 94 84 80] %函数值
>>rule=inline('coefficent(1)+coefficent(2)*abstand+coefficent(3)*abstand.^(-1)+coefficent(4)*abstand.^(-2)+coefficent(5)*abstand.^(-3)','coefficent','abstand')
>>coefficent=nlinfit(abstand,Sensorwerte,rule,[1 1 1 1 1])