MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   急求解答 (https://www.labfans.com/bbs/showthread.php?t=10785)

cufe_nxc 2010-02-21 12:23

急求解答
 
下面是一个比较简单的lsqcurvefit函数,可是matlab总是报错,请各位高手指点!!!
function f=fun(x,tdata)
f=x(1)/(1+(x(1)/5.70533-1)*exp(-x(2)*(tdata-2001)));


clc,clear;
tdata=[2001,2007,2009];
xdata=[5.70533,23.81030,39.45855];x0=[60,0.2];
x=lsqcurvefit(@fun,x0,tdata,xdata)

错误代码:
??? Error using ==> optim\private\lsqncommon
User supplied function failed with the following error:

Error using ==> mrdivide
Matrix dimensions must agree.


所有时间均为北京时间。现在的时间是 05:00

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.