How do I round up a number?

7 vues (au cours des 30 derniers jours)
Qilin
Qilin le 20 Avr 2013
Commenté : Steven Lord le 2 Nov 2019
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

Réponse acceptée

the cyclist
the cyclist le 20 Avr 2013
Modifié(e) : the cyclist le 20 Avr 2013
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 commentaire
Qilin
Qilin le 20 Avr 2013
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.

Connectez-vous pour commenter.

Plus de réponses (1)

Jai
Jai le 2 Nov 2019
how to make a decimal number to always round up to nearest integer
  1 commentaire
Steven Lord
Steven Lord le 2 Nov 2019
Use the ceil function.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by