When does 'interp1' function give 'The grid vector must contain unique points' error?

When does 'interp1' function give 'The grid vector must contain unique points' error?

 采纳的回答

This error comes when there are duplicate points in input to 'interp1'.
You can remove duplicates using 'unique' function.
Example:-
>> [x, index] = unique(x);
>> yi = interp1(x, y(index), xi);

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Interpolation 的更多信息

产品

版本

R2016a

标签

Community Treasure Hunt

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

Start Hunting!

Translated by