MATLAB: Interp1 function gives an error ”Error using griddedInterpolant The grid vectors must contain unique points.” interpolation Size of z_Sd is (200×2) and I am trying to find the corresponding Sd value for a given value say, 0.3157 . vq1=interp1(z_Sd(:,1),z_Sd(:,2),0.3157); However I am getting this error. Help me out Best Answer [x,~,J] = unique(z_Sd(:,1));y = accumarray(J, z_Sd(:,2), [], @mean);vq1 = interp1(x,y,0.3157); Related SolutionsMATLAB: Grid I may be oversimplifying it, but perhaps issue ahold offat the end of the code and see if this gives you behavior you desire.grid minor is a toggle, so that if you issue it and then have a hold on, then when it is issued again, it will toggle off. MATLAB: GriddedInterpolant bug This behavior was fixed in R2012a. If you are current on SMS, you can download R2012a or R2012b for free. Related QuestionWhen I use INTERP1, why do I receive the error “The data abscissae should be distinct”Plot gridWhen does ‘interp1’ function give ‘The grid vector must contain unique points’ errorMake grid
Best Answer