Curve fitting for a trig function

조회 수: 6 (최근 30일)
Yalda
Yalda 2013년 8월 26일
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

채택된 답변

the cyclist
the cyclist 2013년 8월 26일
If you have the Statistics Toolbox, you can use the nlinfit() function to do this.
  댓글 수: 1
Yalda
Yalda 2013년 8월 26일
Is there any other way of doing it? I don't have statistic toolbox now, I have ordered one though, but will probably take me two or 3 days to get it.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Shashank Prasanna
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.

카테고리

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