hcf

Version 1.4.0.0 (601 Bytes) by Nitin
Function to calculate hcf of numbers
115 Downloads
Updated 8 May 2017

View License

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
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Elementary Math in Help Center and MATLAB Answers
Tags Add Tags
hcf

Community Treasure Hunt

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

Start Hunting!
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
Updated option to round off number to nearest integer, if any decimal number is entered

1.0.0.0