FUNCTION REFERENCE
round
Round values to the nearest integer or to a specified precision.
Round values to the nearest integer or to a specified precision.
Syntax
round(X)Syntax
round(X,n) or round(X,n,'decimals')Syntax
round(X,n,'significant')Halves round away from zero. A finite integer n sets the number of decimal places, with negative n rounding to the left of the decimal point. In 'significant' mode, n is a positive count of significant digits. For complex input, each part is rounded separately.
Example
round(2.5) % 3Example
round(2.567,2) % 2.57Example
round(123.456,2,'significant') % 120Differences from MATLAB: Complex results with all imaginary parts zero are returned as real arrays.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.