Hello, I also encountered this issue when I was working on my homework problem.
The minreal function can “output an orthogonal matrix U such that (U*A*U',U*B,C*U') is a Kalman decomposition of (A,B,C)”. It turns out that the algorithm seems to at least switch the positions of the matrix blocks corresponding to
and
. I put in the matrices in my homework problem and compared the direct minreal output with U*B'.
block appears in the first row instead of the second, different from the "official" version
block appears in the first row instead of the second, different from the "official" version I wasn’t able to dig very deep into the problem, but I think the difference is due to the algorithm minreal used. Instead of directly following the steps of Kalman decomposition, minreal converts the state-space system into a transfer function and does the pole-zero cancellation.
Here's an old post: Kalman decomposition (narkive.com)
