|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
function F=myfun(x,xdata)
F=[xdata(:,4)*0.5+(0.005*0.12*x^0.63*550/xdata(:,1))]/[xdata(:,2)+x*xdata(:,3)+0.352*exp(0.0013*(440-xdata(:,1)))+3.665*exp(0.01*(440-xdata(:,1)))+xdata(:,4)*0.5+(0.005*0.12*x^0.63*550/xdata(:,1))];
通过以下的调用
>> ydata = [0.037471 0.034791 0.032611 0.031011 0.029912 0.029635 0.030214 0.030515 0.030613 0.029495 0.026599];
>>xdata = [600 0.245 0.052466152 0.0014;605 0.268 0.076288668 0.0013;610 0.290 0.108099298 0.0013;615 0.300 0.125276835 0.0012;620 0.31 0.107250119 0.0012;625 0.315 0.67450492 0.0011;630 0.32 0.36982112 0.0011;635 0.325 0.020722678 0.0010;640 033 0.13441035 0.0010;645 0.34 0.009481882 0.001;650 0.35 0.007643467 0.0010];
>>x0=40;
>> [x,resnorm] = lsqcurvefit(@myfun,x0,xdata,ydata);
出现问题
Error using ==> c:/matlab6p5p1/toolbox/optim/private/lsqncommon
User supplied function failed with the following error:
Error using ==> +
Matrix dimensions must agree.
Error in ==> C:\MATLAB6p5p1\toolbox\optim\lsqcurvefit.m
On line 129 ==> [x,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
请高手指教 |
|