I have some data that is organized simply as 2D (x,y) coordinates. I have a large amount of this data and while the data for the X axis has the same range for all the points, it doesn't use the same exact X points between data sets. I would like to interpolate each set of data and then grab the same X points for each data set. Whenever I use Matlab to try and interpolate the data I run into problems.
So my data looks like:
x = [0 1 2 3 4 5 6 7]
y = [2.2 3.7 3.9 4.1 4.2 8.9 9.1 9.3]
xq = [0.5 0.75 2 2.25]
where x and y are my recorded data values and xq are the new x points that I would like to get from the interpolated data.
typically I use the interp1 command as such:
f = interp1(x,y,xq);
unfortunately this command produces the error: "The grid vectors are not strictly monotonic increasing." This happens if I use griddata or related commands. I understand that this is because I have data that isn't from a function and therefore I need a technique that deals with scattered data. So I have attempted to use scatteredInterpolant but it appears that this function appears to be not suited for this type of data, as it needs x, y, and a v (value) matrix, which is more dimensions than I have.
I am at a loss on how to continue, advice, and suggestions would be greatly appreciated.
xandyarrays are not the same size. - eigenchrisresamplecan help. - RashidscatteredInterpolantbut set the value of all the y-coordinate values to zero? Would that turn it into a 1-D interpolator? - AnonSubmitter85