Sophie

Sophie

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

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

<html lang="en">
<head>
<title>A Sample Function Description - 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="Format-of-Descriptions.html#Format-of-Descriptions" title="Format of Descriptions">
<link rel="next" href="A-Sample-Command-Description.html#A-Sample-Command-Description" title="A Sample Command Description">
<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="A-Sample-Function-Description"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="A-Sample-Command-Description.html#A-Sample-Command-Description">A Sample Command Description</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Format-of-Descriptions.html#Format-of-Descriptions">Format of Descriptions</a>
<hr>
</div>

<h5 class="subsubsection">1.3.5.1 A Sample Function Description</h5>

<p><a name="index-function-descriptions-16"></a>
In a function description, the name of the function being described
appears first.  It is followed on the same line by a list of parameters. 
The names used for the parameters are also used in the body of the
description.

   <p>Here is a description of an imaginary function <code>foo</code>:

<div class="defun">
&mdash; Function:  <b>foo</b> (<var>x, y, <small class="dots">...</small></var>)<var><a name="index-foo-17"></a></var><br>
<blockquote><p>The function <code>foo</code> subtracts <var>x</var> from <var>y</var>, then adds the
remaining arguments to the result.  If <var>y</var> is not supplied, then the
number 19 is used by default.

     <pre class="example">          foo (1, [3, 5], 3, 9)
               &rArr; [ 14, 16 ]
          foo (5)
               &rArr; 14
</pre>
        <p>More generally,

     <pre class="example">          foo (<var>w</var>, <var>x</var>, <var>y</var>, ...)
          ==
          <var>x</var> - <var>w</var> + <var>y</var> + ...
</pre>
        </blockquote></div>

   <p>Any parameter whose name contains the name of a type (e.g.,
<var>integer</var> or <var>matrix</var>) is expected to be of that
type.  Parameters named <var>object</var> may be of any type.  Parameters
with other sorts of names (e.g., <var>new_file</var>) are discussed
specifically in the description of the function.  In some sections,
features common to parameters of several functions are described at the
beginning.

   <p>Functions in Octave may be defined in several different ways.  The
category name for functions may include another name that indicates the
way that the function is defined.  These additional tags include

     <dl>
<dt>Function File<dd><a name="index-function-file-18"></a>The function described is defined using Octave commands stored in a text
file.  See <a href="Function-Files.html#Function-Files">Function Files</a>.

     <br><dt>Built-in Function<dd><a name="index-built_002din-function-19"></a>The function described is written in a language like C++, C, or Fortran,
and is part of the compiled Octave binary.

     <br><dt>Loadable Function<dd><a name="index-loadable-function-20"></a>The function described is written in a language like C++, C, or Fortran. 
On systems that support dynamic linking of user-supplied functions, it
may be automatically linked while Octave is running, but only if it is
needed.  See <a href="Dynamically-Linked-Functions.html#Dynamically-Linked-Functions">Dynamically Linked Functions</a>.

     <br><dt>Mapping Function<dd><a name="index-mapping-function-21"></a>The function described works element-by-element for matrix and vector
arguments. 
</dl>

   </body></html>