Rounds x to the nearest integer. It is performed element-wise if x is a vector, matrix or signal.
The round(x, d) function rounds x to digit d (d will be converted to an integer). For a negative value of d, x is rounded to the next power of 10, for example round(34, -1) returns 30. This function is performed element-wise if x is a vector, matrix or signal.
Syntax
round(x [, d])
Types
Variable Name | Value Type | Variable Type | ||
---|---|---|---|---|
Argument: | x | real, complex | scalar, vector, matrix, signal, xy-data | |
Optional: | d | real | scalar | |
Result: | real, complex | scalar, vector, matrix, signal, xy-data |
Calculator Input
Use the
button to complete the operation.Example
ID | Description | Type | Value | Expression | |
---|---|---|---|---|---|
x | Argument | REAL VECTOR |
| [2.49,2.5] | |
v1 | Result | REAL VECTOR |
| round(x) | |
v2 | Result | REAL VECTOR |
| round(x,1) |