octave-bug-tracker
[Top][All Lists]
Advanced

[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 00:37:40 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #6, bug #51624 (project octave):

The NaN appear, I assume, because the griddata routine uses interpolation to
establish the values at the mesh points.  Because the rand() routine doesn't
produce any values at -1 and 1, but with minuscule likelihood, no values can
be assigned to the outer mesh points.

Out of curiosity, I added such points:


rand ("state", 1);
x = 2*rand (1000,1) - 1;
x = [x; 1; 1; -1; -1];
y = 2*rand (size (x)) - 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);


That makes griddata produce non-NAN values at the extreme, but I'm not quite
sure why it is creating the surface it is, i.e., extending the edges down to
-0.7568025 everywhere.  Perhaps that is because it's linear.  But it looks
like "cubic" isn't implemented.  "nearest" interpolation of course won't have
such side panels filled in, but it looks rather crude.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51624>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]