diff scripts/linear-algebra/norm.m @ 3372:f16c2ce14886

[project @ 1999-11-23 19:07:09 by jwe]
author jwe
date Tue, 23 Nov 1999 19:07:18 +0000
parents 041ea33fbbf4
children 5e0a0b1cba43
line wrap: on
line diff
--- a/scripts/linear-algebra/norm.m
+++ b/scripts/linear-algebra/norm.m
@@ -17,30 +17,43 @@
 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
-## usage: norm (x, p)
-##
-## Compute the p-norm of x.
-##
-## If x is a matrix:
-##
-##   value of p     norm returns
-##   ----------     ------------
-##       1          1-norm, the largest column sum of x
-##       2          largest singular value of x
-##      Inf         infinity norm, the largest row sum of x
-##     "inf"        same as Inf
-##     "fro"        Frobenius norm of x, sqrt (sum (diag (x' * x)))
-##
-## If x is a vector or a scalar:
-##
-##   value of p     norm returns
-##   ----------     ------------
-##      Inf         max (abs (x))
-##     -Inf         min (abs (x))
-##     other        p-norm of x, sum (abs (x) .^ p) ^ (1/p)
-##
-## If the second argument is missing, p = 2 is assumed.
-##
+## -*- texinfo -*-
+## @deftypefn {Function File} {} norm (@var{a}, @var{p})
+## Compute the p-norm of the matrix @var{a}.  If the second argument is
+## missing, @code{p = 2} is assumed.
+## 
+## If @var{a} is a matrix:
+## 
+## @table @asis
+## @item @var{p} = @code{1}
+## 1-norm, the largest column sum of @var{a}.
+## 
+## @item @var{p} = @code{2}
+## Largest singular value of @var{a}.
+## 
+## @item @var{p} = @code{Inf}
+## @cindex infinity norm
+## Infinity norm, the largest row sum of @var{a}.
+## 
+## @item @var{p} = @code{"fro"}
+## @cindex Frobenius norm
+## Frobenius norm of @var{a}, @code{sqrt (sum (diag (@var{a}' * @var{a})))}.
+## @end table
+## 
+## If @var{a} is a vector or a scalar:
+## 
+## @table @asis
+## @item @var{p} = @code{Inf}
+## @code{max (abs (@var{a}))}.
+## 
+## @item @var{p} = @code{-Inf}
+## @code{min (abs (@var{a}))}.
+## 
+## @item other
+## p-norm of @var{a}, @code{(sum (abs (@var{a}) .^ @var{p})) ^ (1/@var{p})}.
+## @end table
+## @end deftypefn
+
 ## See also: cond, svd
 
 ## Author: jwe