finding fit parameters between two functions
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Eli
el 23 de Dic. de 2023
Comentada: Torsten
el 24 de Dic. de 2023
Hello
I have a script, where i have a simulation that creates a function.
On the other hand I have a measurement. They don't fit and I want to use fminsearch to try to find the variables that can make them fit.
The idea is to find the variables N_set , A_dir, A_seq and maybe some offset in time (x axis)and Const (y axis).
Would appriciate some help.
The simulation and data are presented. this is example of one specific value set, where we can see the don't have a very good overlap.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1574922/image.jpeg)
Would appriciate your help.
Thanks.
load('matlab1.mat')
untitled5()
3 comentarios
Image Analyst
el 23 de Dic. de 2023
Is the function that gives a fit just a single mathematical formula? If so, what is it?
Respuesta aceptada
Torsten
el 23 de Dic. de 2023
Editada: Torsten
el 23 de Dic. de 2023
Make a function that - given tau and the parameters you want to fit - returns I_m(tau).
Then look at the examples for "lsqcurvefit" to see how you can use this function as the "fun" in the call to the optimizer.
Use the parameters you fitted by hand as vector of initial values for the parameter vector.
8 comentarios
Torsten
el 24 de Dic. de 2023
If you use "optimoptions" instead of "optimset", the name is "FiniteDifferenceStepSize".
Glad to hear that it seems to work now.
Más respuestas (0)
Ver también
Categorías
Más información sobre Model Predictive Control Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!