Rounding to next integer

16 ビュー (過去 30 日間)
Nicholas Salce
Nicholas Salce 2016 年 10 月 12 日
コメント済み: Nicholas Salce 2016 年 10 月 12 日
I am trying to create a program to calculate a module size for solar panels. The answers can only be a whole integer value. I tried using round() to do this but in a case where the decimal value is below 0.5 it will round down. I would like it to round all values to the next whole integer. For instance if the calculation gives an answer of 2.1 I want output value to be 3.

採用された回答

Steven Lord
Steven Lord 2016 年 10 月 12 日
See the ceil function.
  1 件のコメント
Nicholas Salce
Nicholas Salce 2016 年 10 月 12 日
Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by