MATLAB: Problem with interp1

interpolationMATLABunique

Hi, for some reason when I try to use the interp1 function it gives me an error "Error using griddedInterpolant. The grid vectors must contain unique points."
but in my code I already accounted for that by doing the following:
dnew = unique([dlrg dmed dsml]);
plrg = interp1(log10(dlrg),plrg,log10(dnew),'linear','extrap');
why is it ignoring the fact that I told it to use unique points?

Best Answer

It is dlrg that must contain unique points. There is no requirement for uniquness on dnew.