find an equation for the set of coordinates
古いコメントを表示

I have the above plot with a different set of coordinates for each object(labeled by different colors). I was wondering if there was a way to find an approximate equation for each object in matlab.
I was thinking about smoothing out the "rougher" parts to make it easier but I'm not sure how to go about doing that. any ideas?
thanks
回答 (2 件)
Image Analyst
2014 年 8 月 12 日
How about just taking the average of the coordinates
windowWidth = 5;
newx = conv(x, ones(1, windowWidth)/windowWidth, 'same');
newy = conv(y, ones(1, windowWidth)/windowWidth, 'same');
4 件のコメント
Duncan
2014 年 8 月 12 日
Image Analyst
2014 年 8 月 12 日
編集済み: Image Analyst
2014 年 8 月 12 日
Huh? Why? conv2() is already like doing a polyfit of order 1 (a line). If you want higher order for less smoothing, use a Savitzky-Golay filter, sgolayfilt() in the Signal Processing Toolbox.
Perhaps increasing sampling and getting a smoother curve via splines would interest you. See attached demo.
Duncan
2014 年 8 月 17 日
Image Analyst
2014 年 8 月 17 日
Sorry - I usually use conv2(), which is for 2D arrays (images). For a 1-D signal, you'd use conv().
Ahmet Cecen
2014 年 8 月 12 日
0 投票
I would use cftool, easier to play around with different fits, and not confined to polynomials.
カテゴリ
ヘルプ センター および File Exchange で Smoothing and Denoising についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!