single

Version:

Converts input elements to single-precision numbers.

Syntax

c = single(a)

a

Numeric scalar or numeric array of any dimension.

c

Elements of a as single-precision numbers. c is a scalar or an array of the same size as a. If a is a complex number, this function converts the real and imaginary parts of the number separately and then returns a complex number that consists of those parts.

Special Cases

If an element in a is greater than the maximum positive number, the corresponding element in c is Inf. If an element in a is less than the minimum positive number and greater than the minimum negative number, the corresponding element in c is 0. If an element in a is less than the minimum negative number, the corresponding element in c is -Inf.

A = int8(12.3)
C = single(A)

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported