Spnull

spnull is a function that computes an orthonormal basis for the null space of a full or sparse matrix. When the matrix is sparse, this computation is performed via the QR decomposition and is typically much faster than using null(full(S)).

Syntax

 * Z = spnull(S)
 * Z = spnull(S,varargin)

Argument descriptions

 * S: The matrix to have its null space computed.
 * varargin (optional): Extra arguments that, if S is full, will be passed to MATLAB's null function.

Examples
The following example gives a 4-by-4 matrix whose null space is spanned by the two vectors $[0,0,1,0]^T$ and $[0,0,0,1]^T$:

Note that the output is sparse because S</tt> is sparse. If the input is full then the output will be full as well: