Problem: Given the matrix \(A\) whose columns represents some vectors, find the set of orthonormal vectors that span the same space as \(A\) and verify the result. Let
Notice that \(A\) has rank 2, so we should get no more than 2 vectors in the orthonormal set.
With MATLAB use the orth(A) function, With Mathematica, use {u,s,v}=SingularValueDecomposition[A] , and since the rank is 2, then the first 2 columns of matrix u will give the answer needed (any 2 columns of u will also give a set of orthonormal vectors).
Matlab clear all; A=[0 1 1 2 1 2 3 4 2 0 2 0]; R=orth(A)
|
R = -0.3782 0.3084 -0.8877 0.1468 -0.2627 -0.9399
|
R'*R
|
1.0000 0.0000 0.0000 1.0000 |