Interpolation points: The grid vectors do not define a grid of points that match the given values.

6 views (last 30 days)
Hello, I'm having a problem to interpolate some points. I think that is a easy thing and I don't see whats is the problem. I want with data_x, data_y and range use iterp1, when: data_x = 0:0.001:1 or data scale data_y = vector 1000x1 with diferent values range = 0:0.004:1
and I do,
data_interp = interp1(data_x, data_y, range);
I solve the problem with the repeated values of data_y, but now, I have this error:
The grid vectors do not define a grid of points that match the given values.
thanks.

Accepted Answer

John D'Errico
John D'Errico on 17 Aug 2015
Edited: John D'Errico on 17 Aug 2015
Um, you tell us that x is a vector of length 1001. (How many points are in the vector 0:.001:1 ?) Then you tell us that y is a vector of length 1000.
Do you see the disconnect? Go back and read the error message again. In general, interpolation requires a set of (x,y) pairs, such that we have y as a function of x at EACH AND EVERY value for x. You do not satisfy that requirement.
  1 Comment
ViniAlmeida
ViniAlmeida on 17 Aug 2015
Thanks for the fast replie, the problem was this. Do you know whats mean I have a data and find a data scale? For example, I'm using a function in matlab that make a data fit with a binomial distribution, the parameters are this, data and data scale. My data are values between 0 and 1, there are 668700 points that I have, so, whats data scale?

Sign in to comment.

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!