Hi ebveryone,
On the attached code I am trying to use lsqcurvefit to estimate the following constants:
% Constants
KSO2 = Constant(1);KHSO3 = Constant(2);KCO2 = Constant(3);KHCO3 = Constant(4);Kw = Constant(5);
whilst using fsolve to solve an equation. Some I get an error message:
Error using pHCalcFeb25>pHCalculationToo many output arguments.Error in lsqcurvefit (line 213) initVals.F = feval(funfcn_x_xdata{3},xCurrent,XDATA,varargin{:});Error in pHCalcFeb25 (line 67) Constant=lsqcurvefit(@pHCalculation,Constant0,t,pH);Caused by: Failure in initial objective function evaluation. LSQCURVEFIT cannot continue. >>
How can I resolve this error. Please help
Best Answer