Index exceeds matrix dimensions (Monod kinetics and curve fitting)

2 次查看(过去 30 天)
Hi, I'm trying to fit dS/dt = -v1*ktot1*SSA1*S*(1-Kad1*S/(1+Kad*S)) on to experimental data (deg25deg.mat). Yet I get this error message:
" Index exceeds matrix dimensions.
Error in dissolutionKinetics/NSdeg25deg (line 10) xdot(1)= -1.*B(1).*B(2).*B(4).*x(1).*(1-((B(3).*x(1))/(1+(B(3).*x(1)))));
Error in odearguments (line 90) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in dissolutionKinetics (line 7) [t1,y1]=ode45(@NSdeg25deg,[0 30],0.01);
Error in lsqcurvefit (line 202) initVals.F = feval(funfcn_x_xdata{3},xCurrent,XDATA,varargin{:});
Error in calling (line 2) [B,Rsdnrm,Rsd,ExFlg,OptmInfo,Lmda,Jmat] = lsqcurvefit(@dissolutionKinetics,B0,Time,deg25deg);
Caused by: Failure in initial objective function evaluation. LSQCURVEFIT cannot continue". I don't know what to change on line 10. Please help. Please find the *.m files on the attachment.
>>
  4 个评论
José-Luis
José-Luis 2017-8-31
It does more than pointing out where the error is.
Place a breakpoint where the error occurs and look at the size of the offending variables where the error occurs.
Dursman Mchabe
Dursman Mchabe 2017-8-31
I am currently trying different things, as I read from previous answers to previous similar question. The current error is "Not enough input arguments". I will keep on trying until I win.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by