mat#

AnsMath.mat(nrow=1, ncol=1, dtype=<class 'numpy.float64'>, init=None, name=None, asarray=False)#

Create a matrix.

Parameters:
nrowint, optional

Number of rows. The default is 1.

ncolint, optional

Number of columns. The default is 1.

dtypenp.dtype, optional

NumPy data type of the matrix. The options are np.double, np.int32, and np.int64. The default is np.double.

initstr, optional

Initialization options. Options are "zeros", "ones", or "rand". The default is "zeros".

namestr, optional

AnsMath matrix name. The default is None, in which case a name is automatically generated.

asarraybool, optional

Whether to return a NumPy array rather than an AnsMath matrix. The default is False.

Returns:
AnsMat or numpy.ndarray

AnsMath matrix or NumPy array matrix, depending on the value for the asarray parameter.