matlab 四种取整函数(fix floor ceil round)的区别
2014-11-06 15:40
549 查看
Matlab取整函数有: fix, floor, ceil, round四种,具体使用方法如下:
(1) fix
朝零方向取整
如
fix(-1.3)=-1
fix(1.3)=1;
(2) floor
朝负无穷方向取整(不超过x 的最大整数.(高斯取整))
如
floor(-1.3)=-2
floor(1.3)=1;
(3) ceil
朝正无穷方向取整(大于x 的最小整数)
如
ceil(-1.3)=-1
ceil(1.3)=2;
(4) round
四舍五入到最近的整数
如
round(-1.3)=-1
round(-1.52)=-2
round(1.3)=1
round(1.52)=2
(1) fix
朝零方向取整
如
fix(-1.3)=-1
fix(1.3)=1;
(2) floor
朝负无穷方向取整(不超过x 的最大整数.(高斯取整))
如
floor(-1.3)=-2
floor(1.3)=1;
(3) ceil
朝正无穷方向取整(大于x 的最小整数)
如
ceil(-1.3)=-1
ceil(1.3)=2;
(4) round
四舍五入到最近的整数
如
round(-1.3)=-1
round(-1.52)=-2
round(1.3)=1
round(1.52)=2
相关文章推荐
- MATLAB的取整函数:fix(x), floor(x) :,ceil(x) , round(x)
- matlab中几种取整函数的用法(fix, floor, ceil, round)
- Matlab取整函数(fix, floor, ceil, round)的使用
- MATLAB中floor、round、ceil、fix区别
- MATLAB中取整函数(fix, floor, ceil, round)的使用
- MATLAB中floor、round、ceil、fix区别
- MATLAB中取整函数(fix, floor, ceil, round)的使用
- 【转】 MATLAB中取整函数(fix, floor, ceil, round)的使用
- MATLAB中floor、round、ceil、fix区别
- MATLAB中取整函数——【fix, floor, ceil, round】的使用
- Matlab中,几个取整(fix,round,ceil,floor)的区别
- MATLAB中取整函数(fix, floor, ceil, round)的使用
- MATLAB的取整函数:fix(x), floor(x) ,ceil(x) , round(x)
- MATLAB取整函数:fix, floor, ceil, round
- matlab中的取整函数,round,fix,floor,ceil
- matlab 关于取整函数 fix, floor, ceil, round
- MATLAB中取整函数(fix, floor, ceil, round)的使用
- MATLAB中取整函数(fix, floor, ceil, round)的使用
- matlab中的fix,round,floor,ceil的区别与涵义
- MATLAB的取整函数:fix(x),floor(x),ceil(x),round(x)