求助matlab高手,用nlinfit曲线拟合时报错!Error using ==> mrdivide Matrix dimensions must agree.函数原型为y=(b1-b2)/(1+e^((x-x0)/d))+b2我的程序:b1,b2,x0,d 为四个待拟合参数y=[-1.5000 -1.9000 -2.0000 -2.1000 -2.4000 -2.6000 -2
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/11 04:56:15
![求助matlab高手,用nlinfit曲线拟合时报错!Error using ==> mrdivide Matrix dimensions must agree.函数原型为y=(b1-b2)/(1+e^((x-x0)/d))+b2我的程序:b1,b2,x0,d 为四个待拟合参数y=[-1.5000 -1.9000 -2.0000 -2.1000 -2.4000 -2.6000 -2](/uploads/image/z/7835724-36-4.jpg?t=%E6%B1%82%E5%8A%A9matlab%E9%AB%98%E6%89%8B%2C%E7%94%A8nlinfit%E6%9B%B2%E7%BA%BF%E6%8B%9F%E5%90%88%E6%97%B6%E6%8A%A5%E9%94%99%21Error+using+%3D%3D%3E+mrdivide+Matrix+dimensions+must+agree.%E5%87%BD%E6%95%B0%E5%8E%9F%E5%9E%8B%E4%B8%BAy%3D%28b1-b2%29%2F%281%2Be%5E%28%28x-x0%29%2Fd%29%29%2Bb2%E6%88%91%E7%9A%84%E7%A8%8B%E5%BA%8F%3Ab1%2Cb2%2Cx0%2Cd+%E4%B8%BA%E5%9B%9B%E4%B8%AA%E5%BE%85%E6%8B%9F%E5%90%88%E5%8F%82%E6%95%B0y%3D%5B-1.5000+-1.9000+-2.0000+-2.1000+-2.4000+-2.6000+-2)
求助matlab高手,用nlinfit曲线拟合时报错!Error using ==> mrdivide Matrix dimensions must agree.函数原型为y=(b1-b2)/(1+e^((x-x0)/d))+b2我的程序:b1,b2,x0,d 为四个待拟合参数y=[-1.5000 -1.9000 -2.0000 -2.1000 -2.4000 -2.6000 -2
求助matlab高手,用nlinfit曲线拟合时报错!Error using ==> mrdivide Matrix dimensions must agree.
函数原型为y=(b1-b2)/(1+e^((x-x0)/d))+b2
我的程序:b1,b2,x0,d 为四个待拟合参数
y=[-1.5000 -1.9000 -2.0000 -2.1000 -2.4000 -2.6000 -2.4000 -2.2000 -2.1000 -1.8000 -2.9000 -3.1000 -3.8000 -4.0000 -4.4000 -5.8000 -6.1000 -6.4000 -4.0000 -5.2000 -6.1000 -7.5000 -6.3000 -6.9000 -7.3000 -7.7000 -5.8000];
x=-32.1:30:747.9;
>> myfunc=inline('beta(2)+(beta(1)-beta(2))/(1+exp((x-beta(3))/beta(4)))','beta','x');
beta=nlinfit(x,y,myfunc,[5 5 5 5]);
求助matlab高手,用nlinfit曲线拟合时报错!Error using ==> mrdivide Matrix dimensions must agree.函数原型为y=(b1-b2)/(1+e^((x-x0)/d))+b2我的程序:b1,b2,x0,d 为四个待拟合参数y=[-1.5000 -1.9000 -2.0000 -2.1000 -2.4000 -2.6000 -2
x=x';y=y';
myfunc=inline('beta(2)+(beta(1)-beta(2))./(1+exp((x-beta(3))/beta(4)))','beta','x');
beta=nlinfit(x,y,myfunc,[5 1 5 5]);
beta
beta =
-1.8795 -6.8170 377.0127 81.2053