Skip to content

hess

Hessenberg form of a matrix.

H = hess(A)
[P, H] = hess(A)
[P, H, Q, Z] = hess(A, B) % generalized

Reduces A to upper-Hessenberg form H (zeros below the first subdiagonal) via an orthogonal similarity transformation. With two outputs, also returns the orthogonal P such that A = P*H*P'.

The two-matrix form computes the generalized Hessenberg reduction: A = P*H*Q' and B = P*T*Z' where H is upper-Hessenberg and T is upper-triangular. Used as a preprocessing step in eigenvalue computations.

[P, H] = hess(magic(4));
norm(P*H*P' - magic(4)) % near-zero
  • eig — Eigenvalues and eigenvectors.
  • schur — Schur decomposition.
  • qr — QR decomposition.