Mercurial > hg > octave-lyh
changeset 9791:6e425f6be618
simplify cummin, cummax docs
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 10 Nov 2009 08:58:26 +0100 |
parents | a5035bc7fbfb |
children | 384616240a8f |
files | src/ChangeLog src/DLD-FUNCTIONS/max.cc |
diffstat | 2 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2009-11-10 Jaroslav Hajek <highegg@gmail.com> + + * DLD-FUNCTIONS/max.cc (Fcummin, Fcummax): Simplify examples in docs. + 2009-11-09 Jaroslav Hajek <highegg@gmail.com> * ov-base.cc (btyp_mixed_numeric): New function.
--- a/src/DLD-FUNCTIONS/max.cc +++ b/src/DLD-FUNCTIONS/max.cc @@ -537,18 +537,16 @@ \n\ The call\n\ @example\n\ - [w, iw] = cummin (x, dim)\n\ + [w, iw] = cummin (x)\n\ @end example\n\ \n\ @noindent\n\ -is equivalent to the following code:\n\ +with @code{x} a vector, is equivalent to the following code:\n\ @example\n\ @group\n\ w = iw = zeros (size (x));\n\ -idxw = idxx = repmat (@{':'@}, 1, ndims (x));\n\ -for i = 1:size (x, dim)\n\ - idxw@{dim@} = i; idxx@{dim@} = 1:i;\n\ - [w(idxw@{:@}), iw(idxw@{:@})] = min(x(idxx@{:@}), [], dim);\n\ +for i = 1:length (x)\n\ + [w(i), iw(i)] = max (x(1:i));\n\ endfor\n\ @end group\n\ @end example\n\ @@ -582,14 +580,12 @@ @end example\n\ \n\ @noindent\n\ -is equivalent to the following code:\n\ +with @code{x} a vector, is equivalent to the following code:\n\ @example\n\ @group\n\ w = iw = zeros (size (x));\n\ -idxw = idxx = repmat (@{':'@}, 1, ndims (x));\n\ -for i = 1:size (x, dim)\n\ - idxw@{dim@} = i; idxx@{dim@} = 1:i;\n\ - [w(idxw@{:@}), iw(idxw@{:@})] = max(x(idxx@{:@}), [], dim);\n\ +for i = 1:length (x)\n\ + [w(i), iw(i)] = max (x(1:i));\n\ endfor\n\ @end group\n\ @end example\n\