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:
- Use unique or uniquetol to determine where the duplicates are.
- Use max to find the maximum value among each set of duplicates
- 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.