This function file calculates the Highest Common Factor of two or more numbers. It uses rem() function to check for common factors of the numbers entered and multiplies them by previous value of hcf calculated. It can calculate HCF of multiple numbers at same time
Cite As
Nitin (2024). hcf (https://www.mathworks.com/matlabcentral/fileexchange/53133-hcf), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Mathematics > Elementary Math >
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.4.0.0 | Title edit |
||
1.3.0.0 | Fixed result when 0 is entered as input |
||
1.2.0.0 | Simplified input variables processing |
||
1.1.0.0 | Updated function file to work when negative values are entered
|
||
1.0.0.0 |