<< bin2num elementary functions ceil >>

cast


Converts variable to a different data type


Syntax


R = cast(V, type_destination)
R = cast(V, 'like', W)

Input argument


V

a variable

type_destination

a string: name of destination data type.

W

a variable

Output argument


R

a variable with new data type.

Description


cast converts variable to a different data type.

R = cast(V, 'like', W) converts varible V to sparsity and same data type than W.

Example


r = cast([3.6 1.2 -2.4], 'like', int64(3))
r = cast([3.6 1.2 -2.4], 'int64')

See also


class.

History


Version Description
1.0.0 initial version

Author


Allan CORNET

<< bin2num elementary functions ceil >>