MATLAB的取整函数:fix(x), floor(x) :,ceil(x) , round(x)
作者:sunooy 来源:转载http://blog.edu.cn/user2/sunooy/archives/2006/1288613.shtml 发布时间:2008-4-13 14:57:13
(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
>>
文章评论 (评论内容只代表网友观点,与本站立场无关!)
评论人:hxh4500 打分:100 分 发表时间:2008-10-30 10:56:47
· 明白了,谢谢了哦!哈哈。。。。。。。。。。。
· 明白了,谢谢了哦!哈哈。。。。。。。。。。。

您当前的位置: