G = gcd(A, B)
[G, C, D] = gcd(A, B)
| Parameter | Description |
|---|---|
| A | a scalar, vector, or matrix of real integer values. |
| B | a scalar, vector, or matrix of real integer values. |
| Parameter | Description |
|---|---|
| G | result of gcd function (Greatest common divisor). |
| C, D | Bezout coefficients such that C .* A + D .* B == G. |
G = gcd(A, B) computes the greatest common divisor using the Euclidian algorithm.
[G, C, D] = gcd(A, B) also returns the Bezout coefficients C and D such that C .* A + D .* B == G. Unsigned integer inputs are not supported by this syntax.
A = [-5 7; 10 0];
B = [-15 3; 50 0];
G = gcd(A, B)
| Version | Description |
|---|---|
| 1.0.0 | initial version |