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

Create a vector or matrix containing all zeros.


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.

namestr, optional

APDLMath matrix name. Optional and defaults to a random name.

asarraybool, optional

Return a scipy array rather than an APDLMath matrix.

AnsVec or AnsMat

APDLMath vector or matrix depending on if ncol is specified.


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)