|MATLAB Function Reference|
Null space of a matrix
Z = null(A)
is an orthonormal basis for the null space of
A obtained from the singular value decomposition. That is,
A*Z has negligible elements,
size(Z,2) is the nullity of
Z'*Z = I.
Z = null(A,'r')
is a "rational" basis for the null space obtained from the reduced row echelon form.
A*Z is zero,
size(Z,2) is an estimate for the nullity of
A, and, if
A is a small matrix with integer elements, the elements of the reduced row echelon form (as computed using
rref) are ratios of small integers.
The orthonormal basis is preferable numerically, while the rational basis may be preferable pedagogically.
Example 1. Compute the orthonormal basis for the null space of a matrix A.
Example 2. Compute the rational basis for the null space of the same matrix