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!