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?

 Réponse acceptée

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);

Plus de réponses (0)

Catégories

En savoir plus sur Interpolation dans Centre d'aide et File Exchange

Produits

Version

R2016a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by