Curve fitting data from a script model

4 次查看(过去 30 天)
Hello!!
I have some data that I need to fit. And I have a model with one variable that fits, but I would like Matlab to calculate the fit instead of doing it manually. But when I try to use fit, the fitted curve is far off... I hope you can help me!
The model calculates f for a given x and Mdot. f is also a [6x1]
x = [6x1];
FUN = fittype('model(x,Mdot)');
fo = fitoptions(FUN);
fo.StartPoint = [0.08*Msun/yr];
fit1 = fit(x,f,FUN)
plot(fit1,x,f)

回答(1 个)

Star Strider
Star Strider 2016-12-1
We don’t have your data or your model. You may need one more parameter to fit your function to your data.
  5 个评论
Maria Munoz
Maria Munoz 2016-12-1
The model is a bit difficult to share, because there are a lot of constants and it calls other functions... But if you have any idea of why it doesn't work, something I could try, I really don't know... I would be forever thankful!
Star Strider
Star Strider 2016-12-1
I would like to help, but without your model and an explanation of it, and especially without knowing (and preferably having a mathematical model of) the process that created your data, there is simply no way to go further.
I will delete my Answer in a few minutes.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by