asarray#

AnsMat.asarray(dtype=None)[source]#

Returns vector as a numpy array.

Parameters:
dtypenumpy.dtype, optional

Numpy data type

Returns:
np.ndarray

Numpy array with the defined data type

Return type:

ndarray

Examples

>>> from ansys.mapdl.core import launch_mapdl
>>> mapdl = launch_mapdl()
>>> mm = mapdl.math
>>> v = mm.ones(10)
>>> v.asarray()
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
>>> v.asarray(dtype=np.int_)
[1 1 1 1 1 1 1 1 1 1]