Main Content


Observability matrix


Ob = obsv(sys)


obsv computes the observability matrix for state-space systems. For an n-by-n matrix A and a p-by-n matrix C, obsv(A,C) returns the observability matrix

Ob=[CCACA2  :CAn1]

with n columns and np rows.

Ob = obsv(sys) calculates the observability matrix of the state-space model sys. This syntax is equivalent to executing

Ob = obsv(sys.A,sys.C)

The model is observable if Ob has full rank n.


Determine if the pair

A =
     1     1
     4    -2

C =
     1     0
     0     1

is observable. Type

Ob = obsv(A,C);

% Number of unobservable states
unob = length(A)-rank(Ob)

These commands produce the following result.

unob =


obsv is here for educational purposes and is not recommended for serious control design. Computing the rank of the observability matrix is not recommended for observability testing. Ob will be numerically singular for most systems with more than a handful of states. This fact is well-documented in the control literature. For example, see Section III in [1].


[1] Paige, C. C. "Properties of Numerical Algorithms Related to Computing Controllability." IEEE Transactions on Automatic Control. Vol. 26, Number 1, 1981, pp. 130-138.

Version History

Introduced before R2006a

See Also