asking matlab operation

3 vues (au cours des 30 derniers jours)
sam arf
sam arf le 1 Fév 2012
hi, I got some problem about math operation
it's like this: 2/2=1 3/2=1.5 rounded up to 2 (so 3/2 = 2) 5/2=2.5 rounded up to 3 ( 5/2 = 3)
so, it's answer is rounded up, in C++ we use operation "!" (3!2=2) if I'm not wrong, so how about in matlab?

Réponse acceptée

the cyclist
the cyclist le 1 Fév 2012
The ceil() function (short for "ceiling") does that. There are also related functions such as floor(), round(), and fix().
  1 commentaire
sam arf
sam arf le 2 Fév 2012
thanks

Connectez-vous pour commenter.

Plus de réponses (0)

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