Contents Previous Next Subchapters

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

Description
Returns the element-by-element value z where z has the same sign as x, |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
     rem(-x, y)
returns
     [-1. , -1.5 , -2 , -0.25]