I am trying to fit function F to experimental data. x_tem and yd are both vectors of size (12,1). The function should find the best fitting value y_tau of the function to the experimental data. I just can't find the mistake - matlab is showing me the error :
Error in lsqcurvefit (line 199)
initVals.F = feval(funfcn_x_xdata{3},xCurrent,XDATA,varargin{:});
Caused by: Failure in initial user-supplied objective function evaluation. LSQCURVEFIT cannot continue.
The code is:
x_tem=Temp_aero_korrektur(:,1);
yd=Temp_aero_korrektur(:,2);
F = @(y_tau,x_tem)((-1)*((273.15-x_tem)*(273.15-y_tau(1))*8.314* (((17.62*x_tem)/(243.12+x_tem))-((17.62*y_tau(1))/(243.12+y_tau(1)))))/(40714.53));
yd_tau = lsqcurvefit(F,-40,x_tem,yd);