The output of the function round(-2.1)
in Matlab is -2
.
To verify this, you can simply enter round(-2.1)
in the command window in Matlab and it will return -2
. The round
function rounds a number to the nearest integer. In this case, -2.1
is closer to -2
than -3
, so it is rounded down to -2
.
gistlibby LogSnag