MATLAB: General Approach to Fitting dozens of curves using the same coefficients

curve fittingdatamultipleOptimization Toolbox

I have 30 data sets. Each data set corresponds to a different value of eta. So data set 1, consisting of x values and y values, is for eta=0.2, then data set 2, consising of x-values and y-values, is for eta=0.25. Does MATLAB offer a manner in which I can fit all of these simultaneously, where the solution is in the form of a polynomial, and it is a function of eta, x, and will have some fitted coefficients, so that each curve is fit properly?
Thanks for your input.

Best Answer

You can use lsqcurvefit to do so, simply by posing the problem as a 30-parameter fit. If you do this, you will want to provide a sparse Jacobian calculation of your own.
However, it might be more efficient, since your eta change gradually, to just run a loop over the data sets, each time initializing eta with the final value from the previous fit.