changeset 23216:54404cc32903 stable

doc: Fix differences between example code and run time results (bug #50282). * container.txi: Fix example of comma-separated lists. * chop.m: Add 'format long' to example code.
author Rik <rik@octave.org>
date Tue, 21 Feb 2017 16:24:19 -0800
parents 0842b119dc1b
children 893d99338cc8
files doc/interpreter/container.txi scripts/general/chop.m
diffstat 2 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/container.txi	Sun Feb 19 20:44:38 2017 +0100
+++ b/doc/interpreter/container.txi	Tue Feb 21 16:24:19 2017 -0800
@@ -1033,21 +1033,27 @@
 
 @example
 @group
-in@{1@} = [10, 20, 30, 40, 50, 60, 70, 80, 90];
+in@{1@} = [10, 20, 30];
 in@{2@} = inf;
 in@{3@} = "last";
 in@{4@} = "first";
 out = cell (4, 1);
-[out@{1:3@}] = find (in@{1 : 3@});
-[out@{4:6@}] = find (in@{[1, 2, 4]@})
+[out@{1:3@}] = in@{1 : 3@};
+[out@{4:6@}] = in@{[1, 2, 4]@})
      @result{} out =
         @{
-          [1,1] = 1
-          [2,1] = 9
-          [3,1] = 90
-          [4,1] = 1
-          [3,1] = 1
-          [4,1] = 10
+           [1,1] =
+         
+              10   20   30
+         
+           [2,1] = Inf
+           [3,1] = last
+           [4,1] =
+         
+              10   20   30
+         
+           [5,1] = Inf
+           [6,1] = first
         @}
 @end group
 @end example
--- a/scripts/general/chop.m	Sun Feb 19 20:44:38 2017 +0100
+++ b/scripts/general/chop.m	Tue Feb 21 16:24:19 2017 -0800
@@ -25,6 +25,7 @@
 ##
 ## @example
 ## @group
+## format long
 ## chop (-pi, 5, 10)
 ##    @result{} -3.14200000000000
 ## chop (-pi, 5, 5)