Contents Previous Next Subchapters

Modulo Function
Syntax z = mod(xy)
See Also rem , colunmod , floor , roundoff , int

Description
Returns the element-by-element modulo function where z has the same sign as y, |z| < |y|, and x - z is divisible by y. The matrices x and y are integer, real, or double-precision matrix.

Example
     x = [1., 1.5, 2., 2.75]
     y = 2.5
     mod(x, y)
returns
     [1. , 1.5 , 2 , 0.25]