求助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/11/25 03:28:54
求助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