![0000 Screenshot.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199125/0000%20Screenshot.png)
give constant parameters to fitnlm
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
FastCar
el 15 de Dic. de 2018
Comentada: Walter Roberson
el 16 de Dic. de 2018
I want to use fitnlm (rather than fminsearch and a cost function) because it has the built in statistics. I need to run the fit of the model with different costant parameters but I am not able to tell the function to pick a parameter from the workspace (the function return an error if I give three arguments like @(parameterToOptimise,xData,constantParameter).
My example is:
fit function
and the values to fit are y and I have a constraint on the area under the curve that is A (depending on the fit problem).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199114/image.png)
I would like to write
@(α,x,Area)[(α+1)*Area/(
-
)*
] (luckly
and
are constant, so I can write the numerical values), but I am not able to give a constant parameter to the function
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199115/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199116/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199117/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199118/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199119/image.png)
0 comentarios
Respuesta aceptada
Image Analyst
el 15 de Dic. de 2018
fitnlm() makes a best fit of your model to your data. I don't believe it takes into account some criteria like the area under the fitted curve is in some range.
I'm attaching a demo to fit a power law with fitnlm(). Change the model to be what you need. If you need more help, attach your data in a .mat file.
![0000 Screenshot.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199125/0000%20Screenshot.png)
3 comentarios
zaydon latif
el 15 de Dic. de 2018
Editada: zaydon latif
el 15 de Dic. de 2018
Image Analyst hello sir , i want help me , i want you email to speak the problem .
i will gratiful to you .
Walter Roberson
el 16 de Dic. de 2018
Image Analyst has a personal policy of not discussing user question in email . Ask your question publicly and someone might volunteer .
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!