The strategy is to put your differential equation and the ODE solver call inside the objective function you want to fit. It integrates the equations with the parameters passed to it, and returns the solved equation as the output of the objective functions. You can specify that c(4) and c(5) are known inside the objective function file, and only fit c(1)...c(3). Specify the initial conditions inside the objective function, or you can also fit them as parameters if you wish. (I’ve done all those.)
With a vector output, you can use nlinfit, lsqcurvefit, or with an extra step, fminsearch to do the fit.
Best Answer