Our FREE site is mostly funded by the Amazon ads ⇓below⇓.
Support us by clicking ⇑above⇑ next time you plan to buy a product on Amazon.
function ans = multiple(x, m)
% multiple : checks whether the first number is
% divisible through the second number.
% INPUTS: The inputs must be integers.
% OUTPUT: Is a boolean value 0 or 1.
% THROWS: Throws a assertion error if the inputs invalid.
assert((isnumeric(x) && isnumeric(m)), "The inputs must be integers")
if m == 0
ans = (x == 0);
ans = (mod(x,m) == 0);