Mercurial > hg > octave-nkf
changeset 20425:4e15a4c331e7
doc: Fix griddata example to new calling convention
* geometry.txi (Interpolation on Scattered Data): Fix griddata example.
* geometryimages.m: Fix griddata call to match documented example and
produce the correct figure.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Fri, 22 May 2015 19:12:57 -0400 |
parents | 561af1ab6099 |
children | b5d2f6954c48 |
files | doc/interpreter/geometry.txi doc/interpreter/geometryimages.m |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/geometry.txi +++ b/doc/interpreter/geometry.txi @@ -433,7 +433,8 @@ y = 2*rand (size (x)) - 1; z = sin (2*(x.^2+y.^2)); [xx,yy] = meshgrid (linspace (-1,1,32)); -griddata (x,y,z,xx,yy); +zz = griddata (x, y, z, xx, yy); +mesh (xx, yy, zz); @end group @end example
--- a/doc/interpreter/geometryimages.m +++ b/doc/interpreter/geometryimages.m @@ -65,7 +65,8 @@ y = 2 * rand (size (x)) - 1; z = sin (2 * (x.^2 + y.^2)); [xx,yy] = meshgrid (linspace (-1,1,32)); - griddata (x,y,z,xx,yy); + zz = griddata (x, y, z, xx, yy); + mesh (xx, yy, zz); print ([nm "." typ], d_typ); elseif (strcmp (nm, "convhull")) x = -3:0.05:3;