+ actual, ...
+ expected);
+
+
+
+% This too.
+actual = rank_k_approximation(A, 13);
+
+unit_test_equals("Full rank approximation of a matrix is itself", ...
+ actual, ...
+ expected);
+
+
+S2 = S;
+S2(3,3) = 0;
+expected = U*S2*V';
+actual = rank_k_approximation(A, 2);
+unit_test_equals("Rank 2 approximation of a matrix is correct", ...
+ true, ...
+ (norm(actual - expected) <= 1e-10));
+
+
+S1 = S2;
+S1(2,2) = 0;
+expected = U*S1*V';
+actual = rank_k_approximation(A, 1);
+unit_test_equals("Rank 1 approximation of a matrix is correct", ...
+ true, ...
+ (norm(actual - expected) <= 1e-10));