Curve fitting for a trig function
6 次查看(过去 30 天)
显示 更早的评论
Hi I want to fit a trig function, and get the R^2 value for a graph that I have already plotted, the data are voltage measurements vs. time and each column has around 360 data. I tried using the basic fitting feature under tools of the plot window, but it seems like its just for polynomial functions. Thanks, Hannah
0 个评论
采纳的回答
the cyclist
2013-8-26
If you have the Statistics Toolbox, you can use the nlinfit() function to do this.
更多回答(1 个)
Shashank Prasanna
2013-8-27
You can do custom fitting using optimization functions from base MATLAB.
Here is a page from the documentation that shows you how to go about doing it:
If you'd like goodness of fit statistics then you will have to manually compute them using the relevant formulae. If you plan on using the Curve Fitting Toolbox or the Statistics Toolbox then you get them for free.
0 个评论
另请参阅
类别
在 Help Center 和 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!