The MATLAB modulo function mod(n,d) returns the remainder after the division of n by d:
mod(n,d)
>>> mod(24,5) 4