changeset 7984:bbaa5d7d0143

Some documentation updates
author David Bateman <dbateman@free.fr>
date Mon, 28 Jul 2008 15:47:40 +0200
parents 91d020444da7
children 85c5c1d55820
files doc/ChangeLog doc/interpreter/arith.txi doc/interpreter/debug.txi doc/interpreter/func.txi doc/interpreter/geometry.txi doc/interpreter/image.txi doc/interpreter/interp.txi doc/interpreter/linalg.txi doc/interpreter/numbers.txi doc/interpreter/octave.texi doc/interpreter/optim.txi doc/interpreter/plot.txi doc/interpreter/quad.txi doc/interpreter/strings.txi doc/interpreter/system.txi doc/interpreter/var.txi
diffstat 16 files changed, 312 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/doc/ChangeLog	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/ChangeLog	Mon Jul 28 15:47:40 2008 +0200
@@ -1,5 +1,30 @@
 2008-07-28  David Bateman  <dbateman@free.fr>
 
+	* interpreter/arith.txi: Document reallog, realpow and realsqrt.
+	* interpreter/dbug.txi: Document the means of setting a breakpoint
+	in a sub-function
+	* interpreter/func.txi: Document nargoutchk and symvar.
+	* interpreter/geometry.txi: Document rectint.
+	* interpreter/image.txi: Document contrast.
+	* interpreter/interp.txi: Document interp1q.
+	* interpreter/linalg.txi: Document planerot, rcond and subspace.
+	* interpreter/numbers.txi: Document data type demotion and single
+	precision data type.
+	* interpreter/plot.txi: Document ginput, gtext,
+	waitforbuttonpress, ezcontour, ezcontourf, ezpolar, ezplot3,
+	ezmesh, ezmeshc, ezsurf, ezsurfc, allchild, findobj and findall
+	functions.
+	* interpreter/quad.txi: Document quadv, quadgk, dblquad and
+	triplequad functions.
+	* interpreter/strings.txi: Document validstring, regexptranslate
+	and isstrprop functions.
+	* interpreter/system.txi: Document addtodate, filemarker and perl
+	functions.
+	* interpreter/var.txi: Document the genvarname and namelengthmax
+	functions.
+	* interpreter/octave.texi: Update table of contents for the above
+	changes.
+
 	* interpreter/plot.txi: Document contourf.
 
 	* interpreter/plot.txi: Clarify the description of OuterPosition
--- a/doc/interpreter/arith.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/arith.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -90,6 +90,12 @@
 
 @DOCSTRING(primes)
 
+@DOCSTRING(reallog)
+
+@DOCSTRING(realpow)
+
+@DOCSTRING(realsqrt)
+
 @DOCSTRING(rem)
 
 @DOCSTRING(round)
--- a/doc/interpreter/debug.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/debug.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -114,6 +114,32 @@
 dbclear ("asind", dbstatus ("asind"));
 @end example
 
+A breakpoint can be set in a subfunction. For example if a file contains
+the functions
+
+@example
+function y = func1 (x)
+  y = func2 (x);
+endfunction
+function y = func2 (x)
+  y = x + 1;
+endfunction
+@end example
+
+@noindent
+then a breakpoint can be set at the start of the subfunction directly
+with
+
+@example
+@group
+dbstop (["func1", filemarker(), "func2"])
+@result{} 5
+@end group
+@end example
+
+Note that @code{filemarker} returns a character that marks the
+subfunctions from the file containing them.
+
 Another simple means of setting a breakpoint in an Octave script is the
 use of the @code{keyboard} function.
 
--- a/doc/interpreter/func.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/func.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -334,6 +334,8 @@
 
 @DOCSTRING(nargchk)
 
+@DOCSTRING(nargoutchk)
+
 @node Variable-length Argument Lists
 @section Variable-length Argument Lists
 @cindex variable-length argument lists
@@ -1063,6 +1065,8 @@
 
 @DOCSTRING(vectorize)
 
+@DOCSTRING(symvar)
+
 @node Commands
 @section Commands
 
--- a/doc/interpreter/geometry.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/geometry.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -336,7 +336,11 @@
 @end group
 @end example
 
-Facets of the Voronoi diagram with a vertex at infinity have infinity area.
+Facets of the Voronoi diagram with a vertex at infinity have infinity
+area. A simplified version of @code{polyarea} for rectangles is
+available with @code{rectint}
+
+@DOCSTRING(rectint)
 
 @DOCSTRING(inpolygon)
 
--- a/doc/interpreter/image.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/image.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -152,6 +152,8 @@
 
 @DOCSTRING(winter)
 
+@DOCSTRING(contrast)
+
 An additional colormap is @code{gmap40}. This code map contains only
 colors with integer values of the red, green and blue components. This
 workaround a limitation on gnuplot 4.0, that does not allow the color of
--- a/doc/interpreter/interp.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/interp.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -82,6 +82,12 @@
 @end float
 @end ifnotinfo
 
+A simplified version of @code{interp1} that performs only linear
+interpolation is available in @code{interp1q}. This argument is slightly
+faster than @code{interp1} as to performs little error checking.
+
+@DOCSTRING(interp1q)
+
 Fourier interpolation, is a resampling technique where a signal is
 converted to the frequency domain, padded with zeros and then
 reconverted to the time domain.
--- a/doc/interpreter/linalg.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/linalg.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -95,6 +95,8 @@
 
 @DOCSTRING(givens)
 
+@DOCSTRING(planerot)
+
 @DOCSTRING(inv)
 
 @DOCSTRING(matrix_type)
@@ -109,6 +111,8 @@
 
 @DOCSTRING(rank)
 
+@DOCSTRING(rcond)
+
 @DOCSTRING(trace)
 
 @DOCSTRING(rref)
@@ -142,6 +146,8 @@
 
 @DOCSTRING(schur)
 
+@DOCSTRING(subspace)
+
 @DOCSTRING(svd)
 
 @c FIXME -- should there be a new section here?
--- a/doc/interpreter/numbers.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/numbers.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -84,16 +84,16 @@
 
 @DOCSTRING(double)
 
-@DOCSTRING(single)
-
 @DOCSTRING(complex)
 
 @menu
-* Matrices::                    
-* Ranges::                      
+* Matrices::
+* Ranges::
+* Single Precision Data Types::
 * Integer Data Types::
 * Bit Manipulations::
-* Logical Values::              
+* Logical Values:: 
+* Promotion and Demotion of Data Types::
 * Predicates for Numeric Objects::  
 @end menu
 
@@ -399,6 +399,42 @@
 expression to determine whether they are all constants.  If they are, it
 replaces the range expression with a single range constant.
 
+@node Single Precision Data Types
+@section Single Precision Data Types
+
+Octave includes support for single precision data types, and most of the
+functions in Octave accept single precision values and return single
+precion answers. A single precision variable is created with the
+@code{sample} function.
+
+@DOCSTRING(single)
+
+for example
+
+@example
+sngl = single (rand (2, 2))
+    @result{} sngl = 0.37569   0.92982
+               0.11962   0.50876
+class (sngl)
+    @result{} single
+@end example
+
+Many functions can also return single precision values directly. For
+example
+
+@example
+ones (2, 2, "single")
+zeros (2, 2, "single")
+eye (2, 2,  "single")
+rand (2, 2, "single")
+NaN (2, 2, "single")
+NA (2, 2, "single")
+Inf (2, 2, "single")
+@end example
+
+@noindent
+will all return single precision matrices.
+
 @node Integer Data Types
 @section Integer Data Types
 
@@ -482,6 +518,8 @@
 result is often floored to the nearest integer. So, the result of
 @code{int32(5)./int32(8)} is @code{1}.
 
+@DOCSTRING(idivide)
+
 @node Bit Manipulations
 @section Bit Manipulations
 
@@ -606,6 +644,76 @@
 
 @DOCSTRING(false)
 
+@node Promotion and Demotion of Data Types
+@section Promotion and Demotion of Data Types
+
+Many operators and functions can work with mixed data types. For example
+
+@example
+uint8 (1) + 1
+    @result{} 2
+@end example
+
+@noindent
+where the above operator works with an 8-bit integer and a double precision
+value and returns an 8-bit integer value. Note that the type is demoted
+to an 8-bit integer, rather than promoted to a double precision value as
+might be expected. The reason is that if Octave promoted values in
+expressions like the above with all numerical constants would need to be
+explicitly cast to the appropriate data type type like
+
+@example
+uint8 (1) + uint8 (1)
+    @result{} 2
+@end example
+
+@noindent
+which becomes difficult for the user to apply uniformly and might allow
+hard to find bugs to be introduced. The same applies to single precision
+values where a mixed operation such as
+
+@example
+single (1) + 1
+    @result{} 2
+@end example
+
+@noindent
+returns a single precision value. The mixed operations that are valid
+and their returned data types are
+
+@multitable @columnfraction .2 .3 .3 .2
+@item @tab Mixed Operation @tab  Result @tab 
+@item @tab double OP single @tab single @tab
+@item @tab double OP integer @tab integer @tab
+@item @tab double OP char @tab double @tab
+@item @tab double OP logical @tab double @tab
+@item @tab single OP integer @tab integer @tab
+@item @tab single OP char @tab single @tab
+@item @tab single OP logical @tab single @tab
+
+The same logic applies to functions with mixed arguments such as
+
+@example
+min (single (1), 0)
+   @result 0
+@end example
+
+@noindent
+where the returned value is single precision.
+
+In the case of mixed type indexed assignments, the type is not
+changed. For example
+
+@example
+x = ones (2, 2);
+x (1, 1) = single (2)
+    @result{} x = 2   1
+            1   1
+@end example
+
+@noindent
+where @code{x} remains of the double precision. 
+
 @node Predicates for Numeric Objects
 @section Predicates for Numeric Objects
 
--- a/doc/interpreter/octave.texi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/octave.texi	Mon Jul 28 15:47:40 2008 +0200
@@ -264,11 +264,13 @@
 
 Numeric Data Types
 
-* Matrices::                    
-* Ranges::                      
+* Matrices::
+* Ranges::
+* Single Precision Data Types::
 * Integer Data Types::
 * Bit Manipulations::
-* Logical Values::              
+* Logical Values:: 
+* Promotion and Demotion of Data Types::
 * Predicates for Numeric Objects::  
 
 Matrices
--- a/doc/interpreter/optim.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/optim.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -137,3 +137,4 @@
 
 @DOCSTRING(gls)
 
+@DOCSTRING(lsqnonneg)
--- a/doc/interpreter/plot.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/plot.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -42,6 +42,7 @@
 * Multiple Plots on One Page::  
 * Multiple Plot Windows::       
 * Printing Plots::              
+* Interacting with plots::
 * Test Plotting Functions::     
 @end menu
 
@@ -67,24 +68,8 @@
 @caption{Simple Two-Dimensional Plot.}
 @end float
 
-The function @code{fplot} also generates two-dimensional plots with
-linear axes using a function name and limits for the range of the
-x-coordinate instead of the x and y data.  For example,
-
-@example
-@group
-fplot (@@sin, [-10, 10], 201);
-@end group
-@end example
-
-@noindent
-produces a plot that is equivalent to the one above, but also includes a
-legend displaying the name of the plotted function.
-
 @DOCSTRING(plot)
 
-@DOCSTRING(fplot)
-
 The functions @code{semilogx}, @code{semilogy}, and @code{loglog} are
 similar to the @code{plot} function, but produce plots in which one or
 both of the axes use log scales.
@@ -196,6 +181,37 @@
 
 @DOCSTRING(caxis)
 
+@node Two-dimensional Function Plotting
+@subsubsection Two-dimensional Function Plotting
+
+Octave can plot a function from a function handle inline function or
+string defining the function without the user needing to explicitly
+create the data to be plotted. The function @code{fplot} also generates
+two-dimensional plots with linear axes using a function name and limits
+for the range of the x-coordinate instead of the x and y data.  For
+example,
+
+@example
+@group
+fplot (@@sin, [-10, 10], 201);
+@end group
+@end example
+
+@noindent
+produces a plot that is equivalent to the one above, but also includes a
+legend displaying the name of the plotted function.
+
+@DOCSTRING(fplot)
+
+Other functions that can create two-dimensional plots directly from a
+function include @code{ezcontour}, @code{ezcontourf} and @code{ezpolar}.
+
+@DOCSTRING(ezcontour)
+
+@DOCSTRING(ezcontourf)
+
+@DOCSTRING(ezpolar)
+
 @node Three-Dimensional Plotting
 @subsection Three-Dimensional Plotting
 
@@ -268,6 +284,19 @@
 
 @DOCSTRING(shading)
 
+@node Two-dimensional Function Plotting
+@subsubsection Two-dimensional Function Plotting
+
+@DOCSTRING(ezplot3)
+
+@DOCSTRING(ezmesh)
+
+@DOCSTRING(ezmeshc)
+
+@DOCSTRING(ezsurf)
+
+@DOCSTRING(ezsurfc)
+
 @node Plot Annotations
 @subsection Plot Annotations
 
@@ -365,6 +394,19 @@
 
 @DOCSTRING(orient)
 
+@node Interacting with plots
+@subsection Interacting with plots
+
+The user can select points on a plot with the @code{ginput} function or
+selction the position at which to place text on the plot with the
+@code{gtext} function using the mouse.
+
+@DOCSTRING(ginput)
+
+@DOCSTRING(waitforbuttonpress)
+
+@DOCSTRING(gtext)
+
 @node Test Plotting Functions
 @subsection Test Plotting Functions
 
@@ -506,6 +548,8 @@
 
 @DOCSTRING(ancestor)
 
+@DOCSTRING(allchild)
+
 You can create axes, line, and patch objects directly using the
 @code{axes}, @code{line}, and @code{patch} functions.  These objects
 become children of the current axes object.
@@ -579,6 +623,7 @@
 * Image Properties::            
 * Patch Properties::            
 * Surface Properties::          
+* Seacrhing Properties::
 @end menu
 
 @node Root Figure Properties
@@ -1138,6 +1183,14 @@
 future version of Octave.
 @end table
 
+@node Seacrhing Properties
+@subsubsection Seacrhing Properties
+
+@DOCSTRING(findobj)
+
+@DOCSTRING(findall)
+
+
 @node Managing Default Properties
 @subsection Managing Default Properties
 
--- a/doc/interpreter/quad.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/quad.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -50,6 +50,12 @@
 @item quadl
 Numerical integration using an adaptive Lobatto rule.
 
+@item quadgk
+Numerical integration using an adaptive Guass-Konrod rule.
+
+@item quadv
+Numerical integration using an adaptive vectorized Simpson's rule.
+
 @item trapz
 Numerical integration using the trapezoidal method.
 @end table
@@ -118,6 +124,10 @@
 
 @DOCSTRING(quadl)
 
+@DOCSTRING(quadgk)
+
+@DOCSTRING(quadv)
+
 @DOCSTRING(trapz)
 
 @DOCSTRING(cumtrapz)
@@ -173,10 +183,10 @@
 @node Functions of Multiple Variables
 @section Functions of Multiple Variables
 
-Octave does not have built-in functions for computing the integral
-of functions of multiple variables.  It is however possible to compute
-the integral of a function of multiple variables using the functions
-for one-dimensional integrals.
+Octave does not have built-in functions for computing the integral of
+functions of multiple variables directly.  It is however possible to
+compute the integral of a function of multiple variables using the
+functions for one-dimensional integrals.
 
 To illustrate how the integration can be performed, we will integrate
 the function
@@ -215,6 +225,19 @@
       @result{} 0.30022
 @end example
 
+The above process can be simplified with the @code{dblquad} and
+@code{triplequad} functions for integrals over two and three
+variables. For example
+
+@example
+I =  dblquad (@(x, y) sin(pi.*x.*y).*sqrt(x.*y), 0, 1, 0, 1)
+      @result{} 0.30022
+@end example
+
+@DOCSTRING(dblquad)
+
+@DOCSTRING(triplequad)
+
 The above mentioned approach works but is fairly slow, and that problem
 increases exponentially with the dimensionality the problem.  Another
 possible solution is to use Orthogonal Collocation as described in the
@@ -250,4 +273,3 @@
 
 
 
-
--- a/doc/interpreter/strings.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/strings.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -228,6 +228,8 @@
 
 @DOCSTRING(strncmpi)
 
+@DOCSTRING(validstring)
+
 @node Manipulating Strings
 @section Manipulating Strings
 
@@ -273,6 +275,8 @@
 
 @DOCSTRING(regexprep)
 
+@DOCSTRING(regexptranslate)
+
 @node String Conversions
 @section String Conversions
 
@@ -358,3 +362,5 @@
 @DOCSTRING(isupper)
 
 @DOCSTRING(isxdigit)
+
+@DOCSTRING(isstrprop)
--- a/doc/interpreter/system.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/system.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -129,12 +129,14 @@
 
 @DOCSTRING(usleep)
 
-@DOCSTRING(  datenum)
+@DOCSTRING(datenum)
 
 @DOCSTRING(datestr)
 
 @DOCSTRING(datevec)
 
+@DOCSTRING(addtodate)
+
 @DOCSTRING(calendar)
 
 @DOCSTRING(weekday)
@@ -196,6 +198,8 @@
 
 @DOCSTRING(filesep)
 
+@DOCSTRING(filemarker)
+
 @DOCSTRING(fullfile)
 
 @DOCSTRING(tempdir)
@@ -251,6 +255,8 @@
 
 @DOCSTRING(dos)
 
+@DOCSTRING(perl)
+
 @DOCSTRING(popen)
 
 @DOCSTRING(pclose)
--- a/doc/interpreter/var.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/var.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -70,6 +70,10 @@
 
 @DOCSTRING(isvarname)
 
+@DOCSTRING(genvarname)
+
+@DOCSTRING(namelengthmax)
+
 @menu
 * Global Variables::            
 * Persistent Variables::