MATLAB provides the function null to compute to vectors spanning the kernel of a matrix mapping. Its name comes from the alternative name "null space" for "kernel". For the computation of the image of a linear mapping you can use the functions orth or colspace.

>> A = [1 0 1; 2 1 1; -1 1 -2]
A =
     1     0     1
     2     1     1
    -1     1    -2
>> null(A,'r') % kernel of A
ans =
    -1
     1
     1
>> rank(A)     % rank of A
ans =
     2
>> orth(A)     % spanning vectors of the image of A
ans =
   -0.4264    0.0000
   -0.6396   -0.7071
    0.6396   -0.7071
>> Asym = sym(A)  % the corresponding exact matrix A
Asym =
[  1, 0,  1]
[  2, 1,  1]
[ -1, 1, -2]
>> colspace(Asym) % column space of A = spanning vectors of the image of A
ans =
[  1, 0]
[  0, 1]
[ -3, 1]
Unlock full access  unlock