control.use_numpy_matrix(flag=True, warn=True)[source]

Turn on/off use of Numpy matrix class for state space operations.

  • flag (bool) – If flag is True (default), use the deprecated Numpy matrix class to represent matrices in the ~control.StateSpace class and functions. If flat is False, then matrices are represented by a 2D ndarray object.

  • warn (bool) – If flag is True (default), issue a warning when turning on the use of the Numpy matrix class. Set warn to false to omit display of the warning message.


Prior to release 0.9.x, the default type for 2D arrays is the Numpy matrix class. Starting in release 0.9.0, the default type for state space operations is a 2D array.


>>> ct.use_numpy_matrix(True, False)
>>> # do some legacy calculations using np.matrix