Mercurial > hg > octave-avbm
changeset 14420:dfb33a5723d2
doc: Fix incorrect diagonal matrix division (bug #35666)
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Wed, 29 Feb 2012 11:57:17 -0500 |
parents | 2258a0b73eb8 |
children | 0ec73cf71556 |
files | doc/interpreter/diagperm.txi |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/diagperm.txi +++ b/doc/interpreter/diagperm.txi @@ -426,12 +426,21 @@ @end example @noindent -This is how you normalize columns of a matrix @var{X} to unit norm: +This is one way to normalize columns of a matrix @var{X} to unit norm: @example @group s = norm (X, "columns"); - X = diag (s) \ X; + X = diag (s) / X; +@end group +@end example + +The same can also be accomplished with broadcasting: + +@example +@group + s = norm (X, "columns"); + X ./= s; @end group @end example