このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
gfpretty
従来の形式の多項式
構文
gfpretty(a)
gfpretty(a,st)
gfpretty(a,st,n)
説明
gfpretty(a)
は、X
を変数として、行ベクトル a
のエントリを昇べきの順の係数として使用して、多項式を従来の形式で表示します。多項式は、昇べきの順に表示されます。ゼロ係数を含む項は、表示されません。
gfpretty(a,st)
は、st
の内容が X
の代わりに変数として使われること以外は、最初の構文と同じです。
gfpretty(a,st,n)
は、st
の内容が X
の代わりに変数として使われ、表示の各行が既定値 79 ではなく幅 n
であること以外は、最初の構文と同じです。
メモ
すべての構文に対して: 固定幅フォントを利用しない場合は、表示内のスペースは正確でないことがあります。
例
GF(81) の要素に関するステートメントを表示します。
% DOCREFG2.M Examples from reference pages % Copyright 2000-2011 The MathWorks, Inc. %% % ============================================== % Documentation example from % gflineq reference page % in matlref2.xml % should have x=[2;1;0], vld=1 % begindocexample gflineq A = [2 0 1; 1 1 0; 1 1 2]; % An example in which the solutions are valid [x,vld] = gflineq(A,[1;0;0],3) % enddocexample gflineq %% % ============================================== % Documentation example from % gflineq reference page % in matlref2.xml % should have x2=[], vld2=0 % should have output 'This linear equation has no solution.' % begindocexample gflineq_ex2 [x2,vld2] = gflineq(zeros(3,3),[2;0;0],3) % enddocexample gflineq_ex2 %% % ============================================== % Documentation example from % gfmul reference page % in matlref2.xml % a should be 6 % begindocexample gfmul p = 3; m = 2; prim_poly = [2 2 1]; field = gftuple([-1:p^m-2]',prim_poly,p); a = gfmul(2,4,field) % enddocexample gfmul %% % GFMINPOL % should have prim_poly=[1 1 0 0 1], gf4=[5 10] % The output is slightly different, but it arises % from those variables prim_poly and gf4. p = 2; m = 4; % Consider elements of GF(16). prim_poly = gfprimdf(4); % Get minimal polys for all elements except 0 and 1. k = [1:p^m-2]; minpolys = gfminpol(k,prim_poly); % Check which minimal polys have degree 2. gf4=[]; for i1 = 1:p^m-2 if length(gftrunc(minpolys(i1,:)))==3 % A degree-2 polynomial gf4=[gf4, i1]; end end disp(['The elements of GF(4) are 0, 1, alpha^',int2str(gf4(1)),... ' and alpha^',int2str(gf4(2))]) disp('where alpha is a root in GF(16) of the polynomial') gfpretty(prim_poly)
以下は出力のサンプルです。
If A is a root of the primitive polynomial 3 4 2 + 2 X + X then the element 22 A can also be expressed as 2 3 2 + A + A