oct

Octal representation of stored integer of fi object

Description

example

b = oct(a) returns the stored integer of fi object a in octal format as a character vector.

Fixed-point numbers can be represented as

$real\text{-}worldvalue={2}^{-fractionlength}×storedinteger$

or, equivalently as

$real\text{-}worldvalue=\left(slope×storedinteger\right)+bias$

The stored integer is the raw binary number, in which the binary point is assumed to be at the far right of the word.

Tip

oct returns the octal representation of the stored integer of a fi object. To obtain the base-n representation of the real-world value of a fi object, use dec2base.

Examples

collapse all

Create a signed fi object with values -1 and 1, a word length of 8 bits, and a fraction length of 7 bits.

a = fi([-1 1], 1, 8, 7)
a =
-1.0000    0.9922

DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 8
FractionLength: 7

Find the octal representation of the stored integers of fi object a.

b = oct(a)
b =
'200   177'

Input Arguments

collapse all

Input array, specified as a fi object.

Data Types: fi 