least square fitting with a data set

I have a matrix A with first column time, second and third column each x and y coordinate of the body.
If I want to plot the path more smoothly using least squares approximation, how should I write my code?
I'm not so sure because x does not go in one direction or increase by 1.

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 12 月 7 日

0 投票

You can use sgolayfilt() or 'smoothingspline' option from curve fitting toolbox. See the answers here for detailed discussion on this topic: https://www.mathworks.com/matlabcentral/answers/682698-curve-fit-or-spline-fit-for-a-wavy-function

カテゴリ

ヘルプ センター および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

製品

質問済み:

2020 年 12 月 7 日

回答済み:

2020 年 12 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by