Interpolating grid data from irregular to regular grid using griddedInterpolant

9 views (last 30 days)
I have a 4 dimensional data. I have it in grid form but they are not equally spaced or we can say it that they are on an irregular grid. I moved towards scatteredInterpolant based technique but my data is too huge that I can't run it on my PC. Then I decided to ask this question from MATLAB community. Let's consider we have a simple example like:
[X1, X2] = ndgrid(1:10,1:10);
X1(8,:) = linspace(7.5,8.5,10)
V = X1.^2 + X2.^2;
As you can see I've made a row in X1 equals to some irregular grid format. Just like:
X1 =
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000 2.0000
3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000
4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000 4.0000
5.0000 5.0000 5.0000 5.0000 5.0000 5.0000 5.0000 5.0000 5.0000 5.0000
6.0000 6.0000 6.0000 6.0000 6.0000 6.0000 6.0000 6.0000 6.0000 6.0000
7.0000 7.0000 7.0000 7.0000 7.0000 7.0000 7.0000 7.0000 7.0000 7.0000
7.5000 7.6111 7.7222 7.8333 7.9444 8.0556 8.1667 8.2778 8.3889 8.5000
9.0000 9.0000 9.0000 9.0000 9.0000 9.0000 9.0000 9.0000 9.0000 9.0000
10.0000 10.0000 10.0000 10.0000 10.0000 10.0000 10.0000 10.0000 10.0000 10.0000
Now when I try to run griddedInterpolant on this grid it gives me error that the data is not in valid NDGRID format.
F = griddedInterpolant(X1,X2,V, 'cubic');
What should I do to tackle this problem of interpolating a irregular gridded data on to a regular grid just like the grid generated from ndgrid. Any help from the community will be helpful.

Answers (1)

Chang-le Liu
Chang-le Liu on 11 Apr 2018
Maybe scatteredInterpolant can work.

Categories

Find more on Interpolation in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!