create a function from temperature data

조회 수: 12 (최근 30일)
susana martins
susana martins 2022년 9월 30일
답변: Star Strider 2022년 9월 30일
I have dataset from temperature and i would like to create a trignometric function to describe daily temperature variation. Is it possible?

답변 (3개)

KSSV
KSSV 2022년 9월 30일
Read about interpft

Walter Roberson
Walter Roberson 2022년 9월 30일
If you have the Curve Fitting Toolbox, you can use curvefitter() https://www.mathworks.com/help/curvefit/curvefitter-app.html . Or for before R2022a use cftool() . You would select "Sum of sine" and 1 term. This would fit your data as a single sine wave with some amplitude, some frequency, and some phase offset.
If you do not have the Curve Fitting Toolbox, you could also use fft() and pick out the largest peak; the location would tell you the primary frequency, and the magnitude and imaginary component there would estimate the amplitude and the phase (but you would have to go back and recompute those to take into account the other frequencies.)

Star Strider
Star Strider 2022년 9월 30일

카테고리

Help CenterFile Exchange에서 Curve Fitting Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by