round

Returns nearest integer to x.

Syntax

R = round(x)

Inputs

x
Type: double
Dimension: matrix

Outputs

R
Type: double
Dimension: matrix

Examples

Simple scalar inputs:
R = round(0.5)
R = round(-0.5)
R = 1
R = -1
Complex number input:
R = round(0.6-0.6i)
R = 1 - i
Matrix inputs:
R = round([0.4, 0.6, 0.5, -0.4, -0.5, -0.6])
R = round([0.5i-0.5, 0.5-0.5i, 0.6i-0.6, 0.6-0.6i, 0.4i-0.4, 0.4-0.4i])
R = [ 0 1 1 -0 -1 -1 ]
R = [ -1 + i, 1 - i, -1 + i, 1 - i, 0, 0]