Interpolation points: The grid vectors do not define a grid of points that match the given values.
6 views (last 30 days)
Show older comments
ViniAlmeida
on 17 Aug 2015
Commented: Eric Sirott
on 22 Aug 2016
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.
1 Comment
Eric Sirott
on 22 Aug 2016
data_x in this example will be a 1001x1 vector which isn't the same size as 1000x1
Accepted Answer
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.
More Answers (0)
See Also
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!