How do I fit a Sinuscurve to my Data-Function, WITHOUT Cftool?

3 ビュー (過去 30 日間)
BrunoChemie
BrunoChemie 2021 年 4 月 16 日
回答済み: Star Strider 2021 年 4 月 16 日
C = dlmread('Spektra_Spektrometer2_p.txt.','\t','A3..B652');
x1= C(:,1);
y1= C(:,2);
[fitresult,gof]= sinFit(x1,y1);
i am Missing this. How do I get those numbers that define the Sinusfit
spek2 = dlmread('Spektra_Spektrometer2_p.txt','\t','A3..B652');
x1 = spek2(:,1);
y1 = spek2(:,2);
[fitresult,gof]= sinFit(x1,y1);
phi = -348.3; %how do i get this??
yfit = -0.28*sin(0.016*x1+phi)+1.284; %how to i get this??

回答 (1 件)

Star Strider
Star Strider 2021 年 4 月 16 日
See if the approach in Curve fitting to a sinusoidal function will do what you want. It uses only core MATLAB functions, no toolboxes.

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by