Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How are initial values chosen for either lsqcurvefit or nlinfit functions?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I want to fit my experimental data to a theoretical model which contains an exponential. I've attached a copy of the code I'm using. I've tried various x0 matrix values, but the same error message keeps popping up:
Caused by: Failure in initial objective function evaluation. LSQCURVEFIT cannot continue.
1 comentario
Respuestas (3)
Torsten
el 19 de Sept. de 2018
There must be some mathematical operation within your objective function that gives Inf, NaN or something similar (e.g. division by zero, log or sqrt of a negative number, exponentiation of a negative number ...).
Best wishes
Torsten.
0 comentarios
Ken Mathai
el 19 de Sept. de 2018
Editada: Walter Roberson
el 19 de Sept. de 2018
3 comentarios
Torsten
el 19 de Sept. de 2018
Linear means: The equation is linear in the parameters.
It is irrelevant how "xdata" enters the equation.
Thus in your case x(1) and x(2) are simply given by
x = [xdata xdata.^2]\ydata
where xdata and ydata are your respective column vectors.
Best wishes
Torsten.
Ken Mathai
el 19 de Sept. de 2018
1 comentario
Torsten
el 20 de Sept. de 2018
It should suffice to have the Optimization Toolbox (lsqcurvefit, fmincon,...)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!