sin and cos Regression

조회 수: 8 (최근 30일)
nicholas m.
nicholas m. 2013년 10월 19일
댓글: Image Analyst 2018년 9월 29일
If I have an x and y data set and I want to make a sin and cos regression out of them how would I do that. I just want Matlab to plot it out, give me a best fit line, and an equation for the functions. Also I would like an R^2 for the best fit line. How would I do this? note:(I only have the college student version.)

답변 (2개)

Image Analyst
Image Analyst 2013년 10월 19일
Can't you just take the FFT and look for the dominant frequency? I'm not sure what a line means when you are trying to fit a sine wave to some data. Don't you want to find the best sine wave that goes through the data?
  댓글 수: 2
nicholas m.
nicholas m. 2013년 10월 19일
We took the data in logger pro so we saw the graph and I know is is a sin function. I have all the data points for one period of the function. Now I just want matlab to draw a regression line through the data points. I believe my professor referred to it exactly as a (sin regression). Can mat lab do this for me and if so how?
Image Analyst
Image Analyst 2013년 10월 19일
If you want something with more precision, then perhaps he is referring to SSA. See the wikipedia page at http://en.wikipedia.org/wiki/Singular_spectrum_analysis.

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


abraj ali
abraj ali 2018년 9월 29일
In a single Matlab script, plot a sine wave and cosine wave over one period (0 to 2π). Checkpoints of the requirements: a. Generate your independent variable first; the step size should be no larger than 0.1 so that it has enough samples to get smooth lines. Plot the two waves on the same graph.
  댓글 수: 1
Image Analyst
Image Analyst 2018년 9월 29일
I think you meant to start a new question with a "tag" of "homework" because this is not an Answer to nicholas's 5 year old question up at the top.

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

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by