Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 3e60ff9d4d6f58c8fbd17208f14089fa > files > 248

octave-doc-3.2.3-3mdv2010.0.i586.rpm

<html lang="en">
<head>
<title>Interpolation on Scattered Data - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Geometry.html#Geometry" title="Geometry">
<link rel="prev" href="Convex-Hull.html#Convex-Hull" title="Convex Hull">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Interpolation-on-Scattered-Data"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="Convex-Hull.html#Convex-Hull">Convex Hull</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Geometry.html#Geometry">Geometry</a>
<hr>
</div>

<h3 class="section">29.4 Interpolation on Scattered Data</h3>

<p>An important use of the Delaunay tessellation is that it can be used to
interpolate from scattered data to an arbitrary set of points.  To do
this the N-simplex of the known set of points is calculated with
<code>delaunay</code>, <code>delaunay3</code> or <code>delaunayn</code>.  Then the
simplicies in to which the desired points are found are
identified.  Finally the vertices of the simplicies are used to
interpolate to the desired points.  The functions that perform this
interpolation are <code>griddata</code>, <code>griddata3</code> and
<code>griddatan</code>.

<!-- ./geometry/griddata.m -->
   <p><a name="doc_002dgriddata"></a>

<div class="defun">
&mdash; Function File: <var>zi</var> = <b>griddata</b> (<var>x, y, z, xi, yi, method</var>)<var><a name="index-griddata-2118"></a></var><br>
&mdash; Function File: [<var>xi</var>, <var>yi</var>, <var>zi</var>] = <b>griddata</b> (<var>x, y, z, xi, yi, method</var>)<var><a name="index-griddata-2119"></a></var><br>
<blockquote>
        <p>Generate a regular mesh from irregular data using interpolation. 
The function is defined by <var>z</var><code> = f (</code><var>x</var><code>, </code><var>y</var><code>)</code>. 
The interpolation points are all <code>(</code><var>xi</var><code>, </code><var>yi</var><code>)</code>.  If
<var>xi</var>, <var>yi</var> are vectors then they are made into a 2D mesh.

        <p>The interpolation method can be <code>"nearest"</code>, <code>"cubic"</code> or
<code>"linear"</code>.  If method is omitted it defaults to <code>"linear"</code>. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002ddelaunay.html#doc_002ddelaunay">delaunay</a>. 
</p></blockquote></div>

<!-- ./geometry/griddata3.m -->
   <p><a name="doc_002dgriddata3"></a>

<div class="defun">
&mdash; Function File: <var>vi</var> = <b>griddata3</b> (<var>x, y, z, v xi, yi, zi, method, options</var>)<var><a name="index-griddata3-2120"></a></var><br>
<blockquote>
        <p>Generate a regular mesh from irregular data using interpolation. 
The function is defined by <var>y</var><code> = f (</code><var>x</var><code>,</code><var>y</var><code>,</code><var>z</var><code>)</code>. 
The interpolation points are all <var>xi</var>.

        <p>The interpolation method can be <code>"nearest"</code> or <code>"linear"</code>. 
If method is omitted it defaults to <code>"linear"</code>. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dgriddata.html#doc_002dgriddata">griddata</a>, <a href="doc_002ddelaunayn.html#doc_002ddelaunayn">delaunayn</a>. 
</p></blockquote></div>

<!-- ./geometry/griddatan.m -->
   <p><a name="doc_002dgriddatan"></a>

<div class="defun">
&mdash; Function File: <var>yi</var> = <b>griddatan</b> (<var>x, y, xi, method, options</var>)<var><a name="index-griddatan-2121"></a></var><br>
<blockquote>
        <p>Generate a regular mesh from irregular data using interpolation. 
The function is defined by <var>y</var><code> = f (</code><var>x</var><code>)</code>. 
The interpolation points are all <var>xi</var>.

        <p>The interpolation method can be <code>"nearest"</code> or <code>"linear"</code>. 
If method is omitted it defaults to <code>"linear"</code>. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dgriddata.html#doc_002dgriddata">griddata</a>, <a href="doc_002ddelaunayn.html#doc_002ddelaunayn">delaunayn</a>. 
</p></blockquote></div>

   <p>An example of the use of the <code>griddata</code> function is

<pre class="example">     rand("state",1);
     x=2*rand(1000,1)-1;
     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);
</pre>
   <p class="noindent">that interpolates from a random scattering of points, to a uniform
grid.

<!-- DO NOT EDIT!  Generated automatically by munge-texi. -->
<!-- Copyright (C) 1996, 1997, 1999, 2000, 2002, 2004, 2006, 2007, 2008, 2009 -->
<!-- John W. Eaton -->
<!-- This file is part of Octave. -->
<!-- Octave is free software; you can redistribute it and/or modify it -->
<!-- under the terms of the GNU General Public License as published by the -->
<!-- Free Software Foundation; either version 3 of the License, or (at -->
<!-- your option) any later version. -->
<!-- Octave is distributed in the hope that it will be useful, but WITHOUT -->
<!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -->
<!-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License -->
<!-- for more details. -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with Octave; see the file COPYING.  If not, see -->
<!-- <http://www.gnu.org/licenses/>. -->
   </body></html>