[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51624] griddata example fails
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #51624] griddata example fails |
Date: |
Tue, 1 Aug 2017 13:08:44 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 |
Follow-up Comment #8, bug #51624 (project octave):
I'm still a bit curious as to why the following example, which only adds the
four points at the corners, results in the attached reconstructed surface:
rand ("state", 1);
x = 2*rand (1000,1) - 1;
y = 2*rand (size (x)) - 1;
x = [x; 1; 1; -1; -1];
y = [y; 1; -1; -1; 1];
z = sin (2*(x.^2+y.^2));
[xx,yy] = meshgrid (linspace (-1,1,32));
zz = griddata (x, y, z, xx, yy);
mesh (xx, yy, zz);
I can imagine that the algorithm somehow fills in those side surfaces by
assuming continuity between those corner points and all the points along the
arches at x=1, at y=1, etc. But I'm wondering if that is something it should
be doing under the circumstances. When there are none of the four corners,
things look reasonable. Implicit in that statement of "reasonable" is that
the reconstructed surface has a certain degree of smoothness, i.e., that it
can't make drastic, high-order transitions between sample points. Experiment
with the above data with:
zz = griddata (x, y, z, xx, yy);
mesh (xx, yy, zz);
zz = griddata (x, y, z, xx, yy, "nearest");
mesh (xx, yy, zz);
zz = griddata (x, y, z, xx, yy, "cubic");
mesh (xx, yy, zz);
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51624>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/