Surface fitting to data
显示 更早的评论
Folks,
I have a custom equation with z=a*x*y which I want to fit to some experimental data. The challenge is that
1) The fit z needs to be calculated for 8 different items. For simplicity, we use the same x,y for each item. Then the sum of these 8 items will compared against the experimental data to which I want to fit.
2) Is this possible either through a) SFTOOL and/or B) Programmable approach?
Thanks in advance B
4 个评论
Sean de Wolski
2013-10-11
I don't understand what the "8 items" are?
Do you have eight coefficients you're looking for? Please elaborate.
bugatti79
2013-10-11
Sean de Wolski
2013-10-11
It needs to be calculated 8 times for the same x and y on each but a different, z?
bugatti79
2013-10-11
回答(2 个)
Sean de Wolski
2013-10-11
编辑:Sean de Wolski
2013-10-11
The curve/surface fitting tool will work for you application. Design the fit within the application, then go to
File -> Generate Code
This will generate a function that you can then save and call with your new z-data. Each time it will return a fit object based on the new z.
Alternatively, you could use LinearModel.fit in the Statistics Toolbox
doc LinearModel.fit
or lsqcurvefit in the Optimization Toolbox, though this is overkill:
And "a" is the parameter to be fit? sftool seems like overkill for something that can be done as simply as
a=x(:).*y(:)\z(:);
类别
在 帮助中心 和 File 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!