Matlab integer format for answer
이전 댓글 표시
How do I get matlab to output the answer of (2+24)/(4*3) as an integer? It keps giving the answer as a decimal
2.166666666666667
채택된 답변
추가 답변 (1개)
Thorsten
2013년 2월 18일
Because the result is not an integer. To convert from decimal to integer, use one of these functions:
round, floor, ceil
댓글 수: 1
Image Analyst
2013년 2월 18일
Those give doubles with no fractional part.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!