control.mateqn._check_shape

control.mateqn._check_shape(M, n, m, square=False, symmetric=False, name='??')[source]

Check the shape and properties of a 2D array.

This function can be used to check to make sure a 2D array_like has the right shape, along with other properties. If not, an appropriate error message is generated.

Parameters
Marray_like

Array to be checked.

nint

Expected number of rows.

mint

Expected number of columns.

squarebool, optional

If True, check to make sure the matrix is square.

symmetricbool, optional

If True, check to make sure the matrix is symmetric.

namestr

Name of the matrix (for use in error messages).

Returns
M2D array

Input array, converted to 2D if needed.