egcd.m

Extended greatest common divisor. Finds g = GCD(x(1), ..., x(end)) and v such that g == sum(v.*x).

Vous suivez désormais cette soumission

[g v] = egcd(x) returns g = gcd(x(1), x(2), ..., x(end)) and v such that g == sum(v.*abs(x)).

Citation pour cette source

Steven Gregory (2026). egcd.m (https://fr.mathworks.com/matlabcentral/fileexchange/23944-egcd-m), MATLAB Central File Exchange. Extrait(e) le .

Remerciements

Inspiré par : nextperm, modinv(x, N), logmod

Informations générales

Compatibilité avec les versions de MATLAB

  • Compatible avec toutes les versions

Plateformes compatibles

  • Windows
  • macOS
  • Linux
Version Publié le Notes de version Action
1.1.0.0

Just realized that egcd works on abs(x) and not x. If you need v, use v = sign(x)*v. Then g == sum(v.*x) will be true.

1.0.0.0