changeset 26600:f6730533820e stable

doc: clean up doc example blocks for accuracy and consistent formatting * bitset.m, circshift.m, idivide.m, int2str.m, integral3.m, num2str.m, rat.m, repelem.m, shiftdim.m, structfun.m, trapz.m, condeig.m, cross.m, qzhess.m, computer.m, fullfile.m, orderfields.m, substruct.m, swapbytes.m, contourc.m, isprime.m, runlength.m, clock.m, date.m: Fix presentation and formatting of example block results. * graphics.cc (Fset): Likewise. * sparse.cc (Fsparse): Likewise.
author Mike Miller <mtmiller@octave.org>
date Tue, 22 Jan 2019 13:45:11 -0800
parents 988118822a92
children de358b26dc88
files libinterp/corefcn/graphics.cc libinterp/corefcn/sparse.cc scripts/general/bitset.m scripts/general/circshift.m scripts/general/idivide.m scripts/general/int2str.m scripts/general/integral3.m scripts/general/num2str.m scripts/general/rat.m scripts/general/repelem.m scripts/general/shiftdim.m scripts/general/structfun.m scripts/general/trapz.m scripts/linear-algebra/condeig.m scripts/linear-algebra/cross.m scripts/linear-algebra/qzhess.m scripts/miscellaneous/computer.m scripts/miscellaneous/fullfile.m scripts/miscellaneous/orderfields.m scripts/miscellaneous/substruct.m scripts/miscellaneous/swapbytes.m scripts/plot/draw/contourc.m scripts/specfun/isprime.m scripts/statistics/runlength.m scripts/time/clock.m scripts/time/date.m
diffstat 26 files changed, 139 insertions(+), 122 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Tue Jan 22 10:49:46 2019 -0800
+++ b/libinterp/corefcn/graphics.cc	Tue Jan 22 13:45:11 2019 -0800
@@ -12217,12 +12217,12 @@
 @group
 hf = figure ();
 set (hf, "paperorientation")
-@result{}  paperorientation:  [ landscape | @{portrait@} | rotated ]
+@result{}  [ landscape | @{portrait@} ]
 @end group
 @end example
 
 @noindent
-shows the paperorientation property can take three values with the default
+shows the paperorientation property can take two values with the default
 being @qcode{"portrait"}.
 @seealso{get}
 @end deftypefn */)
--- a/libinterp/corefcn/sparse.cc	Tue Jan 22 10:49:46 2019 -0800
+++ b/libinterp/corefcn/sparse.cc	Tue Jan 22 13:45:11 2019 -0800
@@ -120,10 +120,10 @@
 @var{i} = [1 1 2]; @var{j} = [1 1 2]; @var{sv} = [3 4 5];
 sparse (@var{i}, @var{j}, @var{sv}, 3, 4)
 @result{}
-Compressed Column Sparse (rows = 3, cols = 4, nnz = 2 [17%])
+   Compressed Column Sparse (rows = 3, cols = 4, nnz = 2 [17%])
 
-  (1, 1) ->  7
-  (2, 2) ->  5
+     (1, 1) ->  7
+     (2, 2) ->  5
 @end group
 @end example
 
@@ -134,10 +134,10 @@
 @var{i} = [1 1 2]; @var{j} = [1 1 2]; @var{sv} = [3 4 5];
 sparse (@var{i}, @var{j}, @var{sv}, 3, 4, "unique")
 @result{}
-Compressed Column Sparse (rows = 3, cols = 4, nnz = 2 [17%])
+   Compressed Column Sparse (rows = 3, cols = 4, nnz = 2 [17%])
 
-  (1, 1) ->  4
-  (2, 2) ->  5
+     (1, 1) ->  4
+     (2, 2) ->  5
 @end group
 @end example
 @seealso{full, accumarray, spalloc, spdiags, speye, spones, sprand, sprandn, sprandsym, spconvert, spfun}
--- a/scripts/general/bitset.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/bitset.m	Tue Jan 22 13:45:11 2019 -0800
@@ -31,7 +31,7 @@
 ## @example
 ## @group
 ## x = bitset (1, 3:5)
-## x =
+##   @result{} x =
 ##
 ##    5    9   17
 ##
@@ -48,7 +48,7 @@
 ## @example
 ## @group
 ## x = bitset ([15 14], 1, [0 1])
-## x =
+##   @result{} x =
 ##
 ##    14    15
 ## @end group
--- a/scripts/general/circshift.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/circshift.m	Tue Jan 22 13:45:11 2019 -0800
@@ -39,24 +39,28 @@
 ##      7, 8, 9];
 ## ## positive shift on rows (1st non-singular dim)
 ## circshift (x, 1)
-##  @result{}  7, 8, 9
-##      1, 2, 3
-##      4, 5, 6
+##   @result{}
+##        7   8   9
+##        1   2   3
+##        4   5   6
 ## ## negative shift on rows (1st non-singular dim)
 ## circshift (x, -2)
-##  @result{}  7, 8, 9
-##      1, 2, 3
-##      4, 5, 6
+##   @result{}
+##        7   8   9
+##        1   2   3
+##        4   5   6
 ## ## no shift of rows, shift columns by 1 (2nd dimension)
 ## circshift (x, [0,1])
-##  @result{}  3, 1, 2
-##      6, 4, 5
-##      9, 7, 8
+##   @result{}
+##        3   1   2
+##        6   4   5
+##        9   7   8
 ## ## shift columns (2nd dimension)
 ## circshift (x, 1, 2)
-##  @result{}  3, 1, 2
-##      6, 4, 5
-##      9, 7, 8
+##   @result{}
+##        3   1   2
+##        6   4   5
+##        9   7   8
 ## @end example
 ## @seealso{permute, ipermute, shiftdim}
 ## @end deftypefn
--- a/scripts/general/idivide.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/idivide.m	Tue Jan 22 13:45:11 2019 -0800
@@ -52,13 +52,13 @@
 ## @example
 ## @group
 ## idivide (int8 ([-3, 3]), int8 (4), "fix")
-##   @result{} int8 ([0, 0])
+##   @result{}   0   0
 ## idivide (int8 ([-3, 3]), int8 (4), "round")
-##   @result{} int8 ([-1, 1])
+##   @result{}  -1   1
 ## idivide (int8 ([-3, 3]), int8 (4), "floor")
-##   @result{} int8 ([-1, 0])
+##   @result{}  -1   0
 ## idivide (int8 ([-3, 3]), int8 (4), "ceil")
-##   @result{} int8 ([0, 1])
+##   @result{}   0   1
 ## @end group
 ## @end example
 ##
--- a/scripts/general/int2str.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/int2str.m	Tue Jan 22 13:45:11 2019 -0800
@@ -24,18 +24,19 @@
 ## @example
 ## @group
 ## int2str (123)
-##      @result{} "123"
+##   @result{} 123
 ##
 ## s = int2str ([1, 2, 3; 4, 5, 6])
-##      @result{} s =
+##   @result{} s =
 ##         1  2  3
 ##         4  5  6
 ##
 ## whos s
-##      @result{}
-##       Attr Name        Size                     Bytes  Class
-##       ==== ====        ====                     =====  =====
-##            s           2x7                         14  char
+##   @result{} Variables in the current scope:
+##         Attr Name        Size                     Bytes  Class
+##         ==== ====        ====                     =====  =====
+##              s           2x7                         14  char
+##      Total is 14 elements using 14 bytes
 ## @end group
 ## @end example
 ##
--- a/scripts/general/integral3.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/integral3.m	Tue Jan 22 13:45:11 2019 -0800
@@ -84,7 +84,7 @@
 ## @group
 ## @var{f} = @@(@var{x},@var{y},@var{z}) ones (size (@var{x}));
 ## @var{q} = integral3 (@var{f}, 0, 1, 0, 1, 0, 1)
-##   @result{} @var{q} =  1
+##   @result{} @var{q} =  1.00000
 ## @end group
 ## @end example
 ##
@@ -97,8 +97,8 @@
 ## @group
 ## @var{f} = @@(@var{x},@var{y}) ones (size (@var{x}));
 ## @var{ymax} = @@(@var{x}) sqrt (1 - @var{x}.^2);
-## @var{zmax} = @@(@var{x}) sqrt (1 - @var{x}.^2 - @var{y}.^2);
-## @var{q} = integral3 (@var{f}, 0, 1, 0, @var{ymax})
+## @var{zmax} = @@(@var{x},@var{y}) sqrt (1 - @var{x}.^2 - @var{y}.^2);
+## @var{q} = integral3 (@var{f}, 0, 1, 0, @var{ymax}, 0, @var{zmax})
 ##   @result{} @var{q} =  0.52360
 ## @end group
 ## @end example
--- a/scripts/general/num2str.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/num2str.m	Tue Jan 22 13:45:11 2019 -0800
@@ -32,23 +32,24 @@
 ## @example
 ## @group
 ## num2str (123.456)
-##      @result{} "123.46"
+##   @result{} 123.456
 ##
 ## num2str (123.456, 4)
-##      @result{} "123.5"
+##   @result{} 123.5
 ##
 ## s = num2str ([1, 1.34; 3, 3.56], "%5.1f")
-##      @result{} s =
-##         1.0  1.3
-##         3.0  3.6
+##   @result{} s =
+##        1.0  1.3
+##        3.0  3.6
 ## whos s
-##      @result{}
-##       Attr Name        Size                     Bytes  Class
-##       ==== ====        ====                     =====  =====
-##            s           2x8                         16  char
+##   @result{} Variables in the current scope:
+##         Attr Name        Size                     Bytes  Class
+##         ==== ====        ====                     =====  =====
+##              s           2x8                         16  char
+##      Total is 16 elements using 16 bytes
 ##
 ## num2str (1.234 + 27.3i)
-##      @result{} "1.234+27.3i"
+##   @result{} 1.234+27.3i
 ## @end group
 ## @end example
 ##
--- a/scripts/general/rat.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/rat.m	Tue Jan 22 13:45:11 2019 -0800
@@ -38,14 +38,14 @@
 ##
 ## @example
 ## @group
-## @var{s} = rat (pi)
+## s = rat (pi)
 ## @result{} s = 3 + 1/(7 + 1/16)
 ##
-## [@var{n}, @var{d}] = rat (pi)
-## @result{} @var{n} =  355
-## @result{} @var{d} =  113
+## [n, d] = rat (pi)
+## @result{} n =  355
+## @result{} d =  113
 ##
-## @var{n}/@var{d} - pi
+## n / d - pi
 ## @result{} 0.00000026676
 ## @end group
 ## @end example
--- a/scripts/general/repelem.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/repelem.m	Tue Jan 22 13:45:11 2019 -0800
@@ -54,7 +54,8 @@
 ## @example
 ## @group
 ## A = magic (3)
-##   @result{}   8   1   6
+##   @result{} A =
+##        8   1   6
 ##        3   5   7
 ##        4   9   2
 ## B1 = [1 2 3];
--- a/scripts/general/shiftdim.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/shiftdim.m	Tue Jan 22 13:45:11 2019 -0800
@@ -37,12 +37,14 @@
 ## @group
 ## x = ones (1, 2, 3);
 ## size (shiftdim (x, -1))
-##    @result{} [1, 1, 2, 3]
+##   @result{}   1   1   2   3
 ## size (shiftdim (x, 1))
-##    @result{} [2, 3]
+##   @result{}   2   3
 ## [b, ns] = shiftdim (x)
-##    @result{} b = [1, 1, 1; 1, 1, 1]
-##    @result{} ns = 1
+##   @result{} b =
+##         1   1   1
+##         1   1   1
+##   @result{} ns = 1
 ## @end group
 ## @end example
 ## @seealso{reshape, permute, ipermute, circshift, squeeze}
--- a/scripts/general/structfun.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/structfun.m	Tue Jan 22 13:45:11 2019 -0800
@@ -45,11 +45,9 @@
 ## s.name2 = "Jill Jones";
 ## structfun (@@(x) regexp (x, '(\w+)$', "matches")@{1@}, s,
 ##            "UniformOutput", false)
-## @result{}
-##    @{
-##      name1 = Smith
-##      name2 = Jones
-##    @}
+##   @result{} scalar structure containing the fields:
+##        name1 = Smith
+##        name2 = Jones
 ## @end group
 ## @end example
 ##
--- a/scripts/general/trapz.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/general/trapz.m	Tue Jan 22 13:45:11 2019 -0800
@@ -44,11 +44,11 @@
 ## x = 0:0.1:1;
 ## y = x.^3;
 ## q = trapz (y)
-##   @result{} q = 2.525   # No scaling
+##   @result{} q = 2.5250
 ## q * 0.1
-##   @result{} q = 0.2525  # Approximation to integral by scaling
+##   @result{} 0.25250
 ## trapz (x, y)
-##   @result{} q = 0.2525  # Same result by specifying @var{x}
+##   @result{} 0.25250
 ## @end group
 ## @end example
 ##
--- a/scripts/linear-algebra/condeig.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/linear-algebra/condeig.m	Tue Jan 22 13:45:11 2019 -0800
@@ -50,7 +50,9 @@
 ## @group
 ## a = [1, 2; 3, 4];
 ## c = condeig (a)
-## @result{} [1.0150; 1.0150]
+##   @result{} c =
+##        1.0150
+##        1.0150
 ## @end group
 ## @end example
 ## @seealso{eig, cond, balance}
--- a/scripts/linear-algebra/cross.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/linear-algebra/cross.m	Tue Jan 22 13:45:11 2019 -0800
@@ -32,8 +32,9 @@
 ##
 ## @example
 ## @group
-## cross ([1,1,0], [0,1,1])
-##      @result{} [ 1; -1; 1 ]
+## cross ([1, 1, 0], [0, 1, 1])
+##   @result{}
+##        1   -1   1
 ## @end group
 ## @end example
 ##
--- a/scripts/linear-algebra/qzhess.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/linear-algebra/qzhess.m	Tue Jan 22 13:45:11 2019 -0800
@@ -29,10 +29,19 @@
 ## @example
 ## @group
 ## [aa, bb, q, z] = qzhess ([1, 2; 3, 4], [5, 6; 7, 8])
-##      @result{} aa = [ -3.02244, -4.41741;  0.92998,  0.69749 ]
-##      @result{} bb = [ -8.60233, -9.99730;  0.00000, -0.23250 ]
-##      @result{}  q = [ -0.58124, -0.81373; -0.81373,  0.58124 ]
-##      @result{}  z = [ 1, 0; 0, 1 ]
+##   @result{} aa =
+##       -3.02244  -4.41741
+##        0.92998   0.69749
+##   @result{} bb =
+##       -8.60233  -9.99730
+##        0.00000  -0.23250
+##   @result{} q =
+##       -0.58124  -0.81373
+##       -0.81373   0.58124
+##   @result{} z =
+##      Diagonal Matrix
+##        1   0
+##        0   1
 ## @end group
 ## @end example
 ##
--- a/scripts/miscellaneous/computer.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/miscellaneous/computer.m	Tue Jan 22 13:45:11 2019 -0800
@@ -31,10 +31,10 @@
 ## @example
 ## @group
 ## computer ()
-##    @print{} i586-pc-linux-gnu
+##    @print{} x86_64-pc-linux-gnu
 ##
 ## mycomp = computer ()
-##    @result{} mycomp = "i586-pc-linux-gnu"
+##    @result{} mycomp = x86_64-pc-linux-gnu
 ## @end group
 ## @end example
 ##
--- a/scripts/miscellaneous/fullfile.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/miscellaneous/fullfile.m	Tue Jan 22 13:45:11 2019 -0800
@@ -32,9 +32,12 @@
 ## @example
 ## @group
 ## fullfile ("/home/username", "data", @{"f1.csv", "f2.csv", "f3.csv"@})
-## @result{}  /home/username/data/f1.csv
-##     /home/username/data/f2.csv
-##     /home/username/data/f3.csv
+##   @result{}
+##       @{
+##         [1,1] = /home/username/data/f1.csv
+##         [1,2] = /home/username/data/f2.csv
+##         [1,3] = /home/username/data/f3.csv
+##       @}
 ## @end group
 ## @end example
 ##
--- a/scripts/miscellaneous/orderfields.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/miscellaneous/orderfields.m	Tue Jan 22 13:45:11 2019 -0800
@@ -41,13 +41,12 @@
 ## @group
 ## s = struct ("d", 4, "b", 2, "a", 1, "c", 3);
 ## t1 = orderfields (s)
-##      @result{} t1 =
-##         @{
-##           a =  1
-##           b =  2
-##           c =  3
-##           d =  4
-##         @}
+##   @result{} t1 =
+##        scalar structure containing the fields:
+##          a =  1
+##          b =  2
+##          c =  3
+##          d =  4
 ## @end group
 ## @end example
 ##
@@ -55,44 +54,41 @@
 ## @group
 ## t = struct ("d", @{@}, "c", @{@}, "b", @{@}, "a", @{@});
 ## t2 = orderfields (s, t)
-##      @result{} t2 =
-##         @{
-##           d =  4
-##           c =  3
-##           b =  2
-##           a =  1
-##         @}
+##   @result{} t2 =
+##        scalar structure containing the fields:
+##          d =  4
+##          c =  3
+##          b =  2
+##          a =  1
 ## @end group
 ## @end example
 ##
 ## @example
 ## @group
 ## t3 = orderfields (s, [3, 2, 4, 1])
-##      @result{} t3 =
-##         @{
-##           a =  1
-##           b =  2
-##           c =  3
-##           d =  4
-##         @}
+##   @result{} t3 =
+##        scalar structure containing the fields:
+##          a =  1
+##          b =  2
+##          c =  3
+##          d =  4
 ## @end group
 ## @end example
 ##
 ## @example
 ## @group
 ## [t4, p] = orderfields (s, @{"d", "c", "b", "a"@})
-##      @result{} t4 =
-##         @{
-##           d =  4
-##           c =  3
-##           b =  2
-##           a =  1
-##         @}
-##         p =
-##            1
-##            4
-##            2
-##            3
+##   @result{} t4 =
+##        scalar structure containing the fields:
+##          d =  4
+##          c =  3
+##          b =  2
+##          a =  1
+##      p =
+##         1
+##         4
+##         2
+##         3
 ## @end group
 ## @end example
 ##
--- a/scripts/miscellaneous/substruct.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/miscellaneous/substruct.m	Tue Jan 22 13:45:11 2019 -0800
@@ -26,21 +26,19 @@
 ## @example
 ## @group
 ## idx = substruct ("()", @{3, ":"@})
-##      @result{}
-##        idx =
-##        @{
+##   @result{} idx =
+##        scalar structure containing the fields:
 ##          type = ()
 ##          subs =
 ##          @{
 ##            [1,1] =  3
 ##            [1,2] = :
 ##          @}
-##        @}
 ## x = [1, 2, 3;
 ##      4, 5, 6;
 ##      7, 8, 9];
 ## subsref (x, idx)
-##    @result{} 7  8  9
+##   @result{}   7   8   9
 ## @end group
 ## @end example
 ## @seealso{subsref, subsasgn}
--- a/scripts/miscellaneous/swapbytes.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/miscellaneous/swapbytes.m	Tue Jan 22 13:45:11 2019 -0800
@@ -26,7 +26,7 @@
 ## @example
 ## @group
 ## swapbytes (uint16 (1:4))
-## @result{} [   256   512   768  1024]
+## @result{}   256   512   768  1024
 ## @end group
 ## @end example
 ##
--- a/scripts/plot/draw/contourc.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/plot/draw/contourc.m	Tue Jan 22 13:45:11 2019 -0800
@@ -59,9 +59,10 @@
 ## x = 0:2;
 ## y = x;
 ## z = x' * y;
-## contourc (x, y, z, 2:3)
-##    @result{}   2.0000   2.0000   1.0000   3.0000   1.5000   2.0000
-##         2.0000   1.0000   2.0000   2.0000   2.0000   1.5000
+## c = contourc (x, y, z, 2:3)
+##   @result{} c =
+##         2.0000   1.0000   1.0000   2.0000   2.0000   3.0000   1.5000   2.0000
+##         4.0000   2.0000   2.0000   1.0000   1.0000   2.0000   2.0000   1.5000
 ## @end group
 ## @end example
 ## @seealso{contour, contourf, contour3, clabel}
--- a/scripts/specfun/isprime.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/specfun/isprime.m	Tue Jan 22 13:45:11 2019 -0800
@@ -41,14 +41,14 @@
 ## @example
 ## @group
 ## isprime (1:6)
-##     @result{} [0, 1, 1, 0, 1, 0]
+##   @result{}  0  1  1  0  1  0
 ## @end group
 ## @end example
 ##
 ## @example
 ## @group
 ## isprime ([i, 2, 3, 5])
-##     @result{} [0, 0, 1, 0]
+##   @result{}  0  0  1  0
 ## @end group
 ## @end example
 ##
--- a/scripts/statistics/runlength.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/statistics/runlength.m	Tue Jan 22 13:45:11 2019 -0800
@@ -29,7 +29,7 @@
 ## @example
 ## @group
 ## runlength ([2, 2, 0, 4, 4, 4, 0, 1, 1, 1, 1])
-## @result{}  [2, 1, 3, 1, 4]
+## @result{}   2   1   3   1   4
 ## @end group
 ## @end example
 ## @seealso{run_count}
--- a/scripts/time/clock.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/time/clock.m	Tue Jan 22 13:45:11 2019 -0800
@@ -29,7 +29,7 @@
 ## @example
 ## @group
 ## fix (clock ())
-##      @result{} [ 1993, 8, 20, 4, 56, 1 ]
+##   @result{}   1993      8     20      4     56      1
 ## @end group
 ## @end example
 ##
--- a/scripts/time/date.m	Tue Jan 22 10:49:46 2019 -0800
+++ b/scripts/time/date.m	Tue Jan 22 13:45:11 2019 -0800
@@ -25,7 +25,7 @@
 ## @example
 ## @group
 ## date ()
-##   @result{} "20-Aug-1993"
+##   @result{} 20-Aug-1993
 ## @end group
 ## @end example
 ## @seealso{now, clock, datestr, localtime}