标签:向上取整 常用 style floor tla matlab str mat log
matlab取整函数:
floor()函数为向下取整函数,如下:
floor(0.5)
ans=
0
floor(-0.5)
ans=
-1
ceil()函数为向上取整,如下:
ceil(0.5)
ans=
1
ceil(-0.5)
ans=
0
round()函数的值始终趋于远离0点,如下:
round(0.5)
ans=
1
round(-0.5)
ans=
-1
fix()函数的值始终趋于靠近0点,如下:
fix(0.5)
ans=
0
fix(-0.5)
ans=
0
标签:向上取整 常用 style floor tla matlab str mat log
原文地址:http://www.cnblogs.com/Mr-Tiger/p/7029271.html