null
Orthonormal basis of the null space of a matrix.
Category: Mathematics > Linear Algebra
Syntax
Z = null(A)
Returns orthonormal vectors Z with A*Z = 0.
Description
The null space is the set of vectors x with A*x = 0. null computes it from the singular value decomposition, treating singular values below a tolerance as zero, so the result is a numerical rank decision.
The basis is not unique: signs and rotations within the space vary. Check A*Z near zero instead of comparing entries with a reference.
Input arguments
A- Matrix.
Output arguments
Z- Matrix whose columns span the null space; it has
n - rank(A)columns, and is empty whenAhas full column rank.
Example
A rank-one matrix
A = [1 1; 1 1];
Z = null(A)
disp(norm(A*Z) < 1e-12)
null(eye(2))
Output
Z = 2×1
-0.7071
0.7071
1
ans = 2×0 empty double matrix