Creates the augmented matrix of a. This is given by
[c * eye(m, m),a; a', zeros(n, n)]This is related to the leasted squared solution of a
\\b, bys * [ r / c; x] = [b, zeros(n, columns(b)]where r is the residual error
r = b - a * xAs the matrix s is symmetric indefinite it can be factorized with
lu, and the minimum norm solution can therefore be found without the need for aqrfactorization. As the residual error will bezeros (m,m)for under determined problems, and example can bem = 11; n = 10; mn = max(m ,n); a = spdiags ([ones(mn,1), 10*ones(mn,1), -ones(mn,1)],[-1,0,1], m, n); x0 = a \ ones (m,1); s = spaugment (a); [L, U, P, Q] = lu (s); x1 = Q * (U \ (L \ (P * [ones(m,1); zeros(n,1)]))); x1 = x1(end - n + 1 : end);To find the solution of an overdetermined problem needs an estimate of the residual error r and so it is more complex to formulate a minimum norm solution using the
spaugmentfunction.In general the left division operator is more stable and faster than using the
spaugmentfunction.