MATLAB: Change the number of digits after decimal point

decimal pointformatnumber of digitsround

Hi everybody
how can I change the number of digits after decimal point? I have a matrix of float numbers i want to transform each number in this matrix from this form x.xxxxxxxxxxxxxxx to this form x.xxxx
thanks

Best Answer

You can use the sprintf or the format option. In your case, you can just type:
format short
into the command window.