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!