I wonder how to get quotient in integer division in MATLAB? Thanks and regards!
Use idivide:
C = idivide(A, B) is the same as A./B except that fractional quotients are rounded toward zero to the nearest integers.
There's a third optional parameter for controlling the rounding behavior that's explained on the MathWorks site that I linked to.
Simply, put as following:
floor(A/B)
floor command rounds the value to the nearest integer, towards negative infinity (-inf
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With