Convert octal number to binary coefficients
collapse all in page
Syntax
b = oct2poly(oct)
b = oct2poly(oct,ord)
Description
b = oct2poly(oct)
convertsan octal number, oct
, to a vector of binary coefficients, b
.
b = oct2poly(oct,ord)
specifiesthe power order, ord
, of the coefficients thatcomprise the output. If omitted, ord
is 'descending'
.
Examples
collapse all
Convert Octal Number to Binary Vector
Open Live Script
Convert the octal number 11
to a binary vector.
b = oct2poly(11)
b = 1×4 1 0 0 1
The binary vector corresponds to the polynomial .
Convert Octal Number to Ascending Order Binary Vector
Open Live Script
Convert the octal number 65
to an ascending order binary vector.
b = oct2poly(65,'ascending')
b = 1×6 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
oct
— Octal number
scalar
Octal number, specified as a positive integer scalar.
Example: 15
Example: 3177
Data Types: double
ord
— Power order
'descending'
(default) | 'ascending'
Power order of the binary coefficients vector, specified asa character vector having a value of 'ascending'
or 'descending'
.
Data Types: char
Output Arguments
collapse all
b
— Binary coefficients
vector
Binary coefficients representing a polynomial, returned as arow vector having length equal to p +1, where p is the order ofoctal input.
Version History
Introduced in R2015b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Contact your local office