Retaining the max value during scattered data interpolation

28 ビュー (過去 30 日間)
Aykut Ayca
Aykut Ayca 2019 年 9 月 25 日
コメント済み: Aykut Ayca 2019 年 9 月 27 日
Hi,
Currently scatteredinterpolant averages out the valus of duplicate data points. Is there a way or a different function to keep the max (or min) of the duplicate values when performing scattered data interpolation?
Thanks,
Aykut

採用された回答

Josh Meyer
Josh Meyer 2019 年 9 月 26 日
You'll need to do this manually before calling scatteredInterpolant. There are a few ways to do it, you could use a logical mask, filter the points out, etc... but here is one method:
  1. Use unique or uniquetol to determine where the duplicates are.
  2. Use max to find the maximum value among each set of duplicates
  3. Index into the array and change the value of all duplicates in each set to the maximum value.
When you call scatteredInterpolant on the resulting matrix, it will still average the duplicates, but they will all have the same value.
  1 件のコメント
Aykut Ayca
Aykut Ayca 2019 年 9 月 27 日
Thank you! uniquetol was the answer in my case.

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

その他の回答 (0 件)

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by