Matlab ROUND function not rounding small decimals away
이전 댓글 표시
Hello,
I am trying to round some numbers but the round function is not giving me what I think I should get.
I have "format long" enabled. After performing a 'meshgrid' fucntion, some of the values are as below:
ans =
66.599999999999994
66.599999999999994
66.599999999999994
66.599999999999994
66.599999999999994
66.599999999999994
59.399999999999999
59.399999999999999
59.399999999999999
59.399999999999999
But when I try
round(ans,8) I still get the same numbers as above. Even round(ans,2) gives me the same numbers. round(ans) gives me:
ans =
67
67
67
67
67
67
59
59
59
59
Which is not what want. Any ideas why 'round' is not actually rounding? I have Matlab 2015a installed
Thanks
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!