idivide
Integer division with rounding option
Description
divides each element of C
= idivide(A
,B
)A
by the corresponding element of
B
, rounded to the nearest integers toward zero. A
and B
must contain real numbers and at least one of them must belong to
an integer class.
If
A
andB
are arrays, then they must belong to the same integer class and have sizes that are compatible.If
A
orB
is a scalar double, then the other input must be an integer class, but notint64
oruint64
. Theidivide
function then returnsC
as the same integer class.
Examples
Input Arguments
Output Arguments
Tips
The function
idivide(A,B,'round')
is the same asA./B
andB.\A
for integer data types. The argumentopt
provides the rounding options forA./B
andB.\A
when dividing integers.MATLAB® does not support complex integer division.
Extended Capabilities
Version History
Introduced in R2006a