tom
tom

Reputation: 1

Is there no basic finite field calculation function on MATLAB?

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?

Upvotes: 0

Views: 53

Answers (1)

Alesof
Alesof

Reputation: 341

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');

Upvotes: 0

Related Questions