% generate a Hessenberg matrix A = rand(5,5); [P,H] = hess(A); H