asarray

AnsMat.asarray(dtype=None)

Returns vector as a numpy array.

Parameters
dtypenumpy.dtype, optional

Numpy data type

Returns
np.ndarray

Numpy array with the defined data type

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]
Return type

ndarray