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 (2026). hcf (https://www.mathworks.com/matlabcentral/fileexchange/53133-hcf), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2007b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Mathematics > Elementary Math >
Find more on Elementary Math in Help Center and MATLAB Answers
Tags
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 |
