distmod(x,n)

Calculate the "distance" (absolute difference) between x and the nearest multiple of the modulus n.

You are now following this Submission

Distmod finds the "distance" (absolute difference) between x and the nearest multiple of the modulus n. This function is useful when answering the question: "Is x a multiple of n, plus or minus some tolerance?"

Cite As

Ted (2026). distmod(x,n) (https://uk.mathworks.com/matlabcentral/fileexchange/52664-distmod-x-n), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0