Is there no basic finite field calculation function on MATLAB?

45 Views Asked by At

I want to do some basic operations on finite fields, such as finding the greatest common factor of two polynomials, factoring polynomials, etc. I find few results on google. I'm new to matlab, doesn't matlab have a convenient function like the c++ NTL number theory library?

1

There are 1 best solutions below

1
Alesof On

You can do basic operations of course. To compute the greatest common divisor of polynomials you can use the "gcd" function. To factorize polynomials you can use "factor".

Example 1 - GCD:

syms x
poly_gcd = gcd(x^3 - 3*x^2 + 3*x - 1, x^2 - 5*x + 4);

Example 2 - Factor:

syms x
poly_fact = factor(x^3 + 2, x, 'FactorMode', 'real');