Remainder After Division for Floating-Point Values You can find the remainder after division by a negative divisor for a set of integers including both positive and negative values. If the divisor is positive the resulting array of the remainder is always positive.Įxample: Remainder After Division for Negative Divisor You can also find the remainder of an array that has both positive and negative values using Matlab mod(). The above code returns a new array, with the remainder of the corresponding element of array a.Įxample: Remainder After Division for Positive and Negative Values % calculate the remainder of each element You can also find the remainder of an array by dividing each element with a divisor. remainder – the output of the function, which is the remainder of the divisionĮxample: Find remainder using Matlab mod() % calculate remainderĮxample: Remainder After Division of an array.divisor – the number that the dividend is being divided by.dividend – the number that is being divided.Syntax: Matlab mod() remainder = mod(dividend, divisor) Matlab mod() function is used to calculate the remainder after division.