MATLAB: Taking the nearest decimals possible

decimal

Hi,
I have a query
i have 2 number
1] 1.6778
2] 2.032
How do i take the number 1.6778 to 1.7 ( nearest value)
and 2.032 to 2.0 ?
Kindly help

Best Answer

Y = round(X,N) where N is the number of digits to the right (when positive) or left (negative).
Alternativly,
y = round(X*10)/10;