matlab取整函数:函数
floor()函数为向下取整函数,以下:
spa
floor(0.5) ans= 0 floor(-0.5) ans= -1
ceil()函数为向上取整,以下: blog
ceil(0.5) ans= 1 ceil(-0.5) ans= 0
round()函数的值始终趋于远离0点,以下:class
round(0.5) ans= 1 round(-0.5) ans= -1
fix()函数的值始终趋于靠近0点,以下:di
fix(0.5) ans= 0 fix(-0.5) ans= 0