フィルターのクリア

irreducibility test

11 ビュー (過去 30 日間)
mmavrop
mmavrop 2012 年 3 月 14 日
編集済み: sqw 2014 年 1 月 20 日
Hi all,
I would like to ask you, about the function irreducible.. http://www.mathworks.com/help/toolbox/mupad/stdlib/irreducible.html
I want to check if a polynomial is irreducible, but I have problem on how to declare the polynomial..I tried the examples o the abov link but matlab returns " ??? Undefined function or variable 'x'."..

採用された回答

Walter Roberson
Walter Roberson 2012 年 3 月 14 日
syms x
evalin(symengine, 'irreducible', x^2 - 2)

その他の回答 (3 件)

Stefan Wehmeier
Stefan Wehmeier 2012 年 3 月 26 日
You have to declare it as a polynomial over GaloisField, e.g.
F = evalin(symengine, 'poly(x^2-2, Dom::GaloisField(5^7)))
feval(symengine, 'irreducible', F)
  2 件のコメント
mmavrop
mmavrop 2012 年 3 月 26 日
thanks a lot!
sqw
sqw 2014 年 1 月 20 日
編集済み: sqw 2014 年 1 月 20 日
hi I want use this function for a loop of polynomial but I cant change the polynomial with symbolic variableas.
for example i want this: syms x z=x^a(n,1)+x^a(n,2)+1 for i=1 we have z=x^19+x^12+1 %%a is a vector and change base for i=1:n i want check the z polynomial is irreducible or not?
F = evalin(symengine, 'poly(z,Dom::GaloisField(2))') F =
poly(z, [z], Dom::GaloisField(2, 1, poly(X7, [X7], IntMod(2)))) feval(symengine, 'irreducible', F)
ans =
TRUE
but this polynomial in not irreducible
the mistake of this answer come from [z] instead of [x]!!!!
please help me to solve it

サインインしてコメントする。


mmavrop
mmavrop 2012 年 3 月 14 日
thank you Walter! I tried your answer and matlab returned "`proc irreducible(p) ... end`" in both cases, (x^2 - 2) and (x^2 + 2).. What am I doing wrong? I am using matlab R2009b..
  2 件のコメント
Walter Roberson
Walter Roberson 2012 年 3 月 14 日
Hmmm.... Say, are you perhaps using the Maple symbolic engine? That was still possible in R2009b even though MuPAD was the default. Your ending of the procedure with "end" is a clue, in that MuPAD ends its procedures with "end_proc" but Maple ends with "end".
The internal Maple name for the procedure was irreduc so you could _try_
feval(symengine, 'irreduc', x^2 - 2)
If that doesn't work, go back to irreducible but with feval
Alexander
Alexander 2012 年 3 月 15 日
feval did the trick for me:
>> syms x
>> feval(symengine, 'irreducible', x^2 + 2)
ans =
TRUE

サインインしてコメントする。


mmavrop
mmavrop 2012 年 3 月 24 日
Thank you so much both! it works! May I ask an other question? Is there a way to find out if a polynomial over galois field is irreducible?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by