balanc — matrix or pencil balancing
[Ab,X]=balanc(A) [Eb,Ab,X,Y]=balanc(E,A)
a real square matrix
a real square invertible matrix
a real square matrix (same dimension as A)
a real square invertible matrix.
Balance a square matrix to improve its condition number.
[Ab,X] = balanc(A) finds a similarity transformation
X such that
Ab = inv(X)*A*X has approximately equal row and column norms.
For matrix pencils,balancing is done for improving the generalized eigenvalue problem.
[Eb,Ab,X,Y] = balanc(E,A) returns left and right transformations X and Y
such that Eb=inv(X)*E*Y, Ab=inv(X)*A*Y