\section{NORM Norm Calculation}

\subsection{Usage}

Calculates the norm of a matrix.  There are two ways to
use the \verb|norm| function.  The general syntax is
\begin{verbatim}
   y = norm(A,p)
\end{verbatim}
where \verb|A| is the matrix to analyze, and \verb|p| is the
type norm to compute.  The following choices of \verb|p|
are supported
\begin{itemize}
\item  \verb|p = 1| returns the 1-norm, or the max column sum of A

\item  \verb|p = 2| returns the 2-norm (largest singular value of A)

\item  \verb|p = inf| returns the infinity norm, or the max row sum of A

\item  \verb|p = 'fro'| returns the Frobenius-norm (vector Euclidean norm, or RMS value)

\end{itemize}
For a vector, the regular norm calculations are performed:
\begin{itemize}
\item  \verb|1 <= p < inf| returns \verb|sum(abs(A).^p)^(1/p)|

\item  \verb|p| unspecified returns \verb|norm(A,2)|

\item  \verb|p = inf| returns max(abs(A))

\item  \verb|p = -inf| returns min(abs(A))

\end{itemize}
\subsection{Examples}

Here are the various norms calculated for a sample matrix
\begin{verbatim}
--> A = float(rand(3,4))
A = 
  <float>  - size: [3 4]
 
Columns 1 to 4
 0.426610678  0.075468481  0.871337116  0.487616807  
 0.879925549  0.154911667  0.373149037  0.475030541  
 0.041696656  0.165778294  0.552217603  0.506726503  
--> norm(A,1)
ans = 
  <float>  - size: [1 1]
 1.7967038  
--> norm(A,2)
ans = 
  <float>  - size: [1 1]
 1.5921172  
--> norm(A,inf)
ans = 
  <float>  - size: [1 1]
 1.8830168  
--> norm(A,'fro')
ans = 
  <float>  - size: [1 1]
 1.7142895  

\end{verbatim}
Next, we calculate some vector norms.
\begin{verbatim}
--> A = float(rand(4,1))
A = 
  <float>  - size: [4 1]
 
Columns 1 to 1
 0.68404633  
 0.20355032  
 0.90988815  
 0.69708711  
--> norm(A,1)
ans = 
  <double>  - size: [1 1]
 2.4945719242095947  
--> norm(A,2)
ans = 
  <float>  - size: [1 1]
 1.3502514  
--> norm(A,7)
ans = 
  <double>  - size: [1 1]
 0.9436675093733905  
--> norm(A,inf)
ans = 
  <float>  - size: [1 1]
 0.90988815  
--> norm(A,-inf)
ans = 
  <float>  - size: [1 1]
 0.20355032  

\end{verbatim}
