码迷,mamicode.com
首页 > 其他好文 > 详细

MATLAB取整函数 fix floor ceil round

时间:2015-03-04 22:26:03      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:

MATLAB取整函数
(1)fix(x) : 截尾取整.
>> fix( [3.12 -3.12])
ans =
     3    -3
(2)floor(x):不超过x 的最大整数.(高斯取整)
>> floor( [3.12 -3.12])
ans =
     3    -4
(3)ceil(x) : 大于x 的最小整数
>> ceil( [3.12 -3.12])
ans =
     4    -3
(4)四舍五入取整
>> round(3.12 -3.12)
ans =
     0
>> round([3.12 -3.12])
ans =
     3    -3

MATLAB取整函数 fix floor ceil round

标签:

原文地址:http://www.cnblogs.com/h1359705211/p/4314328.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!