zeros

MapdlMath.zeros(nrow, ncol=None, dtype=<class 'numpy.float64'>)

Create a vector or matrix containing all zeros.

Parameters
nrowint

Number of rows.

ncolint, optional

Number of columns. If specified, returns a matrix.

dtypenp.dtype, optional

Datatype of the vector. Must be either np.int32, np.int64, or np.double.

Returns
AnsVec or AnsMat

APDLMath vector or matrix depending on if ncol is specified.

Examples

Create a zero vector.

>>> from ansys.mapdl.core import launch_mapdl
>>> mapdl = launch_mapdl()
>>> mm = mapdl.math()
>>> vec = mm.zeros(10)

Create a zero matrix.

>>> mat = mm.zeros(10, 10)