The most likely cause is that you have set format long
.
Try typing format
or format short
at Matlab prompt.
Example:
>> format long
>> 15.12
ans
15.119999999999999
>> format
>> 15.12
ans =
15.1200
質問
Example command and output:
>> 15.12
ans =
15.119999999999999"
I'm trying to show only two significant digits (I'm putting values into a uitable) so this is driving me crazy.
解決
The most likely cause is that you have set format long
.
Try typing format
or format short
at Matlab prompt.
Example:
>> format long
>> 15.12
ans
15.119999999999999
>> format
>> 15.12
ans =
15.1200
他のヒント
If you just want to show two digits use
>> format bank
>> 15.2
ans =
15.20
See the Matlab Doc for further details.