Contenu principal

roundn

(Not recommended) Round to multiple of 10n

The roundn function is not recommended. Use the round function instead. For more information, see Version History.

Description

Y = roundn(X,n) rounds each element of X to the nearest multiple of 10n.

example

Examples

collapse all

Round pi to the nearest hundredth.

Y = roundn(pi,-2)
Y =

    3.1400

Input Arguments

collapse all

Input array, specified as a scalar, vector, matrix, or multidimensional array. For complex values of X, the function rounds the real and imaginary parts independently.

Data Types: single | double
Complex Number Support: Yes

Exponent of 10, specified as a scalar integer.

Version History

Introduced before R2006a

collapse all

See Also