egcd.m

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

Download
Download

You are now following this Submission

Cite As

Steven Gregory (2026). egcd.m (https://in.mathworks.com/matlabcentral/fileexchange/23944-egcd-m), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.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.

Download
1.0.0

Download