egcd.m

版本 1.1.0.0 (1.4 KB) 作者: Steven Gregory
Extended greatest common divisor. Finds g = GCD(x(1), ..., x(end)) and v such that g == sum(v.*x).
611.0 次下载
更新时间 2011/1/24

查看许可证

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

引用格式

Steven Gregory (2024). egcd.m (https://www.mathworks.com/matlabcentral/fileexchange/23944-egcd-m), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2007a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Data Import and Export 的更多信息
致谢

参考作品: nextperm, modinv(x, N), logmod

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
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