Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

oct2poly

Convert octal number to binary coefficients

Syntax

b = oct2poly(oct)
b = oct2poly(oct,ord)

Description

example

b = oct2poly(oct) converts an octal number, oct, to a vector of binary coefficients, b.

b = oct2poly(oct,ord) specifies the power order, ord, of the coefficients that comprise the output. If omitted, ord is 'descending'.

Examples

collapse all

Convert the octal number 11 to a binary vector.

b = oct2poly(11)
b = 

     1     0     0     1

The binary vector corresponds to the polynomial .

Convert the octal number 65 to an ascending order binary vector.

b = oct2poly(65,'ascending')
b = 

     1     0     1     0     1     1

Sixty-five octal is the generator polynomial of a (15,10) Hamming code in the Bluetooth v4.0 standard. The binary representation of 65 octal is 110101 and the GF(2) polynomial is or [1 0 1 0 1 1] in ascending powers.

Input Arguments

collapse all

Octal number, specified as a positive integer scalar.

Example: 15

Example: 3177

Data Types: double

Power order of the binary coefficients vector, specified as a character vector having a value of 'ascending' or 'descending'.

Data Types: char

Output Arguments

collapse all

Binary coefficients representing a polynomial, returned as a row vector having length equal to p + 1, where p is the order of octal input.

Data Types: double

See Also

| | |

Introduced in R2015b

Was this topic helpful?