MATLAB: How to round to nearest ‘k’ decimal place in MATLAB 7.8 (R2009a)

MATLAB

MATLAB's ROUND function only rounds to the nearest integer, but I want to round to the 3rd decimal place, for example.

Best Answer

The ability to ROUND to the ‘k’ decimal place (for example the 3rd decimal place) is not available in MATLAB 7.8 (R2009a).
To work around this issue use this command:
x = 1.2345;
xround = round(x*1000)/1000;