フィルターのクリア

How to export a fourier series in its function form after using the curve-fitting method?

2 ビュー (過去 30 日間)
I have constructed the following fitting for some periodic data y(:,1), so
theta_fit = fit(t,y(:,1),'fourier8'),
theta_fit =
General model Fourier8:
theta_fit(x) =
a0 + a1*cos(x*w) + b1*sin(x*w) +
a2*cos(2*x*w) + b2*sin(2*x*w) + a3*cos(3*x*w) + b3*sin(3*x*w) +
a4*cos(4*x*w) + b4*sin(4*x*w) + a5*cos(5*x*w) + b5*sin(5*x*w) +
a6*cos(6*x*w) + b6*sin(6*x*w) + a7*cos(7*x*w) + b7*sin(7*x*w) +
a8*cos(8*x*w) + b8*sin(8*x*w)
I know I can plot them using
plot(t,theta_fit(t),'r')
But then how do I extract theta_fit(x) as a symbolic functio, such that I can use theta_fit(t) in some other programs?

採用された回答

Roger
Roger 2015 年 4 月 6 日
save theta_fit(t) fitdata; load fitdata;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet 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