comparison doc/interpreter/diagperm.txi @ 14423:62cb605af1af

doc: Further fixes diagperm (bug #35666)
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Wed, 29 Feb 2012 16:47:20 -0500
parents 0ec73cf71556
children 72b8b39e12be
comparison
equal deleted inserted replaced
14422:428faafdfa54 14423:62cb605af1af
429 This is one way to normalize columns of a matrix @var{X} to unit norm: 429 This is one way to normalize columns of a matrix @var{X} to unit norm:
430 430
431 @example 431 @example
432 @group 432 @group
433 s = norm (X, "columns"); 433 s = norm (X, "columns");
434 X = diag (s) / X; 434 X /= diag (s);
435 @end group 435 @end group
436 @end example 436 @end example
437 437
438 The same can also be accomplished with broadcasting: 438 @noindent
439 The same can also be accomplished with broadcasting
440 (@pxref{Broadcasting}):
439 441
440 @example 442 @example
441 @group 443 @group
442 s = norm (X, "columns"); 444 s = norm (X, "columns");
443 X ./= s; 445 X ./= s;
452 @example 454 @example
453 det (eye (length (p))(p, :)) 455 det (eye (length (p))(p, :))
454 @end example 456 @end example
455 457
456 @noindent 458 @noindent
457 Finally, here's how you solve a linear system @code{A*x = b} 459 Finally, here's how you solve a linear system @code{A*x = b}
458 with Tikhonov regularization (ridge regression) using SVD (a skeleton only): 460 with Tikhonov regularization (ridge regression) using SVD (a skeleton only):
459 461
460 @example 462 @example
461 @group 463 @group
462 m = rows (A); n = columns (A); 464 m = rows (A); n = columns (A);