Rounding to next integer

조회 수: 15 (최근 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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by