Mean of an oscillatory trajectory
4 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have a particle moving in oscillatory path. See the plot of distantce vs time plot. How do I find the mean trajectory ?
0 件のコメント
採用された回答
Daniel Bengtson
2023 年 8 月 7 日
p = polyfit(t,X,2); % fit a second order polynomial to the data
newT = linspace(min(t),max(t)); % 100 evenly spaced steps over the range of t
Y = polyval(p,newT); % evaluate the polynomial at these steps
plot(newT,Y);
4 件のコメント
Daniel Bengtson
2023 年 8 月 8 日
I should have thought on it more before posting. You are right to question my answer. Polyfit is just a least squares regression and given that I did not take any steps to enforce an intercept at zero, and that the error between the theoretical mean trajectory and raw signal would be relatively small near zero compared to near t max, it probably isn't as good of a fit as it could have been.
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!