changeset 11968:087e5d3a82a6 release-3-2-x

Expand documentation for 'complex' function
author Rik <rdrider0-list@yahoo.com>
date Sat, 06 Jun 2009 22:01:10 -0700
parents 85bbe9e61647
children 3daadc82aee9
files src/ChangeLog src/data.cc src/ov-flt-re-mat.cc src/ov-re-mat.cc
diffstat 4 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-06  Rik  <rdrider0-list@yahoo.com>
+
+	* data.cc: Update documentation for 'complex' function
+
 2009-06-06  Rik  <rdrider0-list@yahoo.com>
 
 	* load-save.cc: Update documentation for NA and isna functions
--- a/src/data.cc
+++ b/src/data.cc
@@ -2783,9 +2783,20 @@
 
 DEFUN (complex, args, ,
   "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} complex (@var{val})\n\
+@deftypefn  {Built-in Function} {} complex (@var{x})\n\
 @deftypefnx {Built-in Function} {} complex (@var{re}, @var{im})\n\
-Convert @var{x} to a complex value.\n\
+Return a complex result from real arguments.  With 1 real argument @var{x},\n\
+return the complex result @code{@var{x} + 0i}.  With 2 real arguments,\n\
+return the complex result @code{@var{re} + @var{im}}.  @code{complex} can\n\
+often be more convenient than expressions such as @code{a + i*b}.\n\
+For example:\n\
+\n\
+@example\n\
+complex ([1, 2], [3, 4])\n\
+@result{}\n\
+   1 + 3i   2 + 4i\n\
+@end example\n\
+@seealso{real, imag, iscomplex}\n\
 @end deftypefn")
 {
   octave_value retval;
--- a/src/ov-flt-re-mat.cc
+++ b/src/ov-flt-re-mat.cc
@@ -816,6 +816,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} single (@var{x})\n\
 Convert @var{x} to single precision type.\n\
+@seealso{double}\n\
 @end deftypefn")
 {
   // The OCTAVE_TYPE_CONV_BODY3 macro declares retval, so they go
--- a/src/ov-re-mat.cc
+++ b/src/ov-re-mat.cc
@@ -844,6 +844,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} double (@var{x})\n\
 Convert @var{x} to double precision type.\n\
+@seealso{single}\n\
 @end deftypefn")
 {
   // The OCTAVE_TYPE_CONV_BODY3 macro declares retval, so they go