1.fix(X):截尾取整
2.floor(x)的不超过X的最大整数
3.ceil(x)大于x的最小整数
4.round(4/6)四舍五入取整
%testDivision
a = 10
b = 3
c = a/b;
aa = fix(37/10);
floor(5.6);
cc=4/6
ceil(cc)
round(4/6)
结果:
a =
10
b =
3
aa =
3.7000
>> matlabTest
data =
I: [256x256 uint8]
J: [1 2 3 4 5]
data =
I: [256x256 double]
J: [1 2 3 4 5]
a =
10
b =
3
aa =
3
>> matlabTest
data =
I: [256x256 uint8]
J: [1 2 3 4 5]
data =
I: [256x256 double]
J: [1 2 3 4 5]
a =
10
b =
3
aa =
3
ans =
5
>> matlabTest
data =
I: [256x256 uint8]
J: [1 2 3 4 5]
data =
I: [256x256 double]
J: [1 2 3 4 5]
a =
10
b =
3
cc =
0.6667
ans =
1
>> matlabTest
data =
I: [256x256 uint8]
J: [1 2 3 4 5]
data =
I: [256x256 double]
J: [1 2 3 4 5]
a =
10
b =
3
cc =
0.6667
ans =
1
ans =
1