How do I round up a number?

조회 수: 7 (최근 30일)
Qilin
Qilin 2013년 4월 20일
댓글: Steven Lord 2019년 11월 2일
Hi, I was wondering whether there's any function other than 'round(X)' that can round up a number? I'm trying not to use round(X) because every time I use it, I get an error: Subscript indices must either be real positive integers or logicals. Thanks

채택된 답변

the cyclist
the cyclist 2013년 4월 20일
편집: the cyclist 2013년 4월 20일
You are probably getting that error because somehow you have created a variable called "round".
What do you get if you type
>> which round
  댓글 수: 1
Qilin
Qilin 2013년 4월 20일
Oh my you're right, I forgot that I actually have a variable called 'round'. I'll change the variable to another name. Thank you for you help.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Jai
Jai 2019년 11월 2일
how to make a decimal number to always round up to nearest integer
  댓글 수: 1
Steven Lord
Steven Lord 2019년 11월 2일
Use the ceil function.

댓글을 달려면 로그인하십시오.

카테고리

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