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

17 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 29 Dec 2016
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);

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Tags

Products


Release

R2016a

Community Treasure Hunt

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

Start Hunting!