Sophie

Sophie

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

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

<html lang="en">
<head>
<title>Test Plotting Functions - 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="Plotting-Basics.html#Plotting-Basics" title="Plotting Basics">
<link rel="prev" href="Interacting-with-plots.html#Interacting-with-plots" title="Interacting with plots">
<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="Test-Plotting-Functions"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="Interacting-with-plots.html#Interacting-with-plots">Interacting with plots</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Plotting-Basics.html#Plotting-Basics">Plotting Basics</a>
<hr>
</div>

<h4 class="subsection">15.1.8 Test Plotting Functions</h4>

<p>The functions <code>sombrero</code> and <code>peaks</code> provide a way to check
that plotting is working.  Typing either <code>sombrero</code> or <code>peaks</code>
at the Octave prompt should display a three-dimensional plot.

<!-- ./plot/sombrero.m -->
   <p><a name="doc_002dsombrero"></a>

<div class="defun">
&mdash; Function File:  <b>sombrero</b> (<var>n</var>)<var><a name="index-sombrero-1104"></a></var><br>
<blockquote><p>Produce the familiar three-dimensional sombrero plot using <var>n</var>
grid lines.  If <var>n</var> is omitted, a value of 41 is assumed.

        <p>The function plotted is

     <pre class="example">          z = sin (sqrt (x^2 + y^2)) / (sqrt (x^2 + y^2))
</pre>
        <!-- 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_002dsurf.html#doc_002dsurf">surf</a>, <a href="doc_002dmeshgrid.html#doc_002dmeshgrid">meshgrid</a>, <a href="doc_002dmesh.html#doc_002dmesh">mesh</a>. 
</p></blockquote></div>

<!-- ./plot/peaks.m -->
   <p><a name="doc_002dpeaks"></a>

<div class="defun">
&mdash; Function File:  <b>peaks</b> ()<var><a name="index-peaks-1105"></a></var><br>
&mdash; Function File:  <b>peaks</b> (<var>n</var>)<var><a name="index-peaks-1106"></a></var><br>
&mdash; Function File:  <b>peaks</b> (<var>x, y</var>)<var><a name="index-peaks-1107"></a></var><br>
&mdash; Function File: <var>z</var> = <b>peaks</b> (<var><small class="dots">...</small></var>)<var><a name="index-peaks-1108"></a></var><br>
&mdash; Function File: [<var>x</var>, <var>y</var>, <var>z</var>] = <b>peaks</b> (<var><small class="dots">...</small></var>)<var><a name="index-peaks-1109"></a></var><br>
<blockquote><p>Generate a function with lots of local maxima and minima.  The function
has the form

     <pre class="verbatim">     f(x,y) = 3*(1-x)^2*exp(-x^2 - (y+1)^2) ...
              - 10*(x/5 - x^3 - y^5)*exp(-x^2-y^2) ...
              - 1/3*exp(-(x+1)^2 - y^2)
</pre>

        <p>Called without a return argument, <code>peaks</code> plots the surface of the
above function using <code>mesh</code>.  If <var>n</var> is a scalar, the <code>peaks</code>
returns the values of the above function on a <var>n</var>-by-<var>n</var> mesh over
the range <code>[-3,3]</code>.  The default value for <var>n</var> is 49.

        <p>If <var>n</var> is a vector, then it represents the <var>x</var> and <var>y</var> values
of the grid on which to calculate the above function.  The <var>x</var> and
<var>y</var> values can be specified separately. 
<!-- 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_002dsurf.html#doc_002dsurf">surf</a>, <a href="doc_002dmesh.html#doc_002dmesh">mesh</a>, <a href="doc_002dmeshgrid.html#doc_002dmeshgrid">meshgrid</a>. 
</p></blockquote></div>

   </body></html>