egcd.m
Version 1.1.0.0 (1.45 KB) by
Steven Gregory
Extended greatest common divisor. Finds g = GCD(x(1), ..., x(end)) and v such that g == sum(v.*x).
[g v] = egcd(x) returns g = gcd(x(1), x(2), ..., x(end)) and v such that g == sum(v.*abs(x)).
Cite As
Steven Gregory (2023). egcd.m (https://www.mathworks.com/matlabcentral/fileexchange/23944-egcd-m), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2007a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired by: nextperm, modinv(x, N), logmod
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.