Why griddatan return NaN values when interpolating 3D and higher input data?

Hi, I want to use Griddatan for 6D interpolation, right now I am testing it with 3D input data but my result is always NaN and a warning that says " Matrix is singular to working precision" I am testing it with simple data like this
A= [2 4 4; 2 2 4; 4 2 4;4 4 4];
GX= [1;1;2;2];
GY= [2;1;1;2];
GZ= [2;2;2;2];
AI= [3 3 4];
GIX= mygriddatan(A,GX,AI,'linear');
GIY= mygriddatan(A,GY,AI,'linear');
GIZ= mygriddatan(A,GZ,AI,'linear');

Risposte (1)

John D'Errico
John D'Errico il 15 Apr 2016
Modificato: John D'Errico il 15 Apr 2016
You have 4 points in three dimensions. But really, they do not live in three dimensions. They all lie in EXACTLY one plane. You do not have three dimensional data. See that All the points have a constant value of Z=2.
Then you somehow hope to magically interpolate to find the value when Z=4. Sorry, but this is not gonna happen. This is not how interpolation works. Maybe it is time to do some reading online about interpolation?
The first flag that you are doing something wrong was the singular matrix.

Categorie

Richiesto:

il 15 Apr 2016

Modificato:

il 15 Apr 2016

Community Treasure Hunt

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

Start Hunting!

Translated by