isprimitive
True for primitive polynomial for Galois field
Description
Examples
Check If Specific Polynomials Are Primitive
Find all the primitive polynomials for GF(8).
a = primpoly(3,'all','nodisplay') % All primitive polynomials for GF(8)
a = 2×1
11
13
Use isprimitive
to check if specific polynomials are primitive.
isp1 = isprimitive(13) % 13 represents a primitive polynomial.
isp1 = logical
1
isp2 = isprimitive(14) % 14 represents a nonprimitive polynomial.
isp2 = logical
0
Examining the vector a
, you can see that isp1
is true because 13 is an element in a
and isp2
is false because 14 is not an element in a
.
Input Arguments
prpoly
— Primitive polynomial
character vector | string scalar | nonnegative integer | Galois row vector
Primitive polynomial, specified as one of the following:
A nonnegative integer less than 217. The binary representation of this integer indicates the coefficients of the polynomial. In this case, m is
floor(log2(prpoly))
.A Galois row vector in GF(2), listing the coefficients of the polynomial in order of descending powers. In this case, m is the order of the polynomial represented by
prpoly
.
Data Types: double
Output Arguments
ispl
— True or false
0
| 1
True or false result, returned as logical 1 (true) or logical 0 (false) indicating if the input is primitive or not.
Data Types: logical
Version History
Introduced before R2006a
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
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:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
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)