フィルターのクリア

Resampling a set of 2D Points to a certain value

6 ビュー (過去 30 日間)
Math Enthusiast
Math Enthusiast 2018 年 11 月 1 日
コメント済み: Math Enthusiast 2018 年 11 月 9 日
Hi,
I have set of 2D Points in a matrix.Lets assume,that its size is around 30. I would like to resample it to around 55 points,with no duplication of points as well as retaining the initial coordinates.
I would be really glad,if someone can let me know regarding this.

採用された回答

KSSV
KSSV 2018 年 11 月 1 日
Let x and y be your 2D points which are 30 in number.
xi = linspace(min(x),max(x),50) ;
yi = interp1(x,y,xi) ;
iwant = [xi yi]
  3 件のコメント
KSSV
KSSV 2018 年 11 月 9 日
Do the unique X's have unique y's? If so remove them.
Math Enthusiast
Math Enthusiast 2018 年 11 月 9 日
I modified my code like this :
[x, index] = unique(x);
xi = linspace(min(x),max(x),70) ;
yi = interp1(x,y(index),xi) ;
iwant = [xi yi];
scatter(xi,yi,'r');
But result looks really bad :(.
The initial and final (after interpolating look like this):
Hope you understand,what I exactly need.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by