Computes the Greatest Common Divisor of the values in array N using the Euclidean algorithm.
The gcd() function of Matlab is not designed for an array.
Thanks to Shashank, taken from https://www.mathworks.com/matlabcentral/newsreader/view_thread/240937
Cite As
Ambroise (2024). GCD(N) (https://www.mathworks.com/matlabcentral/fileexchange/52049-gcd-n), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2011a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Arithmetic Operations in Help Center and MATLAB Answers
Tags
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.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 | updated description |