rem

The resulting remainder of x / y.

Syntax

rem(x,y)

Inputs

x
The dividend.
Type: double | integer | char | string | logical | struct | cell
Dimension: scalar | vector | matrix
y
The divisor.
Type: double | integer | char | string | logical | struct | cell
Dimension: scalar | vector | matrix

Outputs

R
The remainder.
scalar | vector | matrix

Examples

Simple scalar input:
rem(2.7,7.1)
R = 2.7
Simple scalar with matrix input:
rem(5,[2,31;4,14])
R = [ 1 5 ; 1 5 ]
Matrix input:
rem([-1,6;8.1,-2.5],[1.7,-8.3;3.3,1])
R = [ -1 6 ; 1.5 -0.5 ]