Contents Previous Next Subchapters

Conversion To Single-Precision
Syntax real(value)
See Also mlmode_real , isreal , int , double , coercion

Returns the element-by-element conversion of value to a single-precision number.

If value is complex, real will return only the real part of value. (Note that double will return the same value but in the same precision as a complex value.) If you enter
     real(1.5r0 + 2.1i0)
O-Matrix will return
If value is a character matrix, real will return the ASCII value of each element of value.
     [ 120 , 121 , 122 ]
If value is a logical matrix, real will return 1 for each true element and 0 for each false element. If you enter
O-Matrix will respond