Matlab take the whole function
1) fix (x): Truncate rounding.
>> fix ([3.12-3.12])
Ans =
3-3
(2) floor (x): The largest integer not exceeding x. (Gaussian rounding)
>> floor ([3.12-3.12])
Ans =
3-4
(3) Ceil (x): smallest integer greater than X
>> ceil ([3.12-3.12])
Ans =
4-3
(4) Rounding round and rounding
>> Round (3.12-3.12)
Ans =
0
>> round ([3.12-3.12])
Ans =
3-3
In Matlab, the following methods are used in four rounding functions:
Matlab Rounding functions are: fix, floor, ceil, round.
Fix
Rounding in 0 directions, such as fix (-1.3) =-1; Fix (1.3) = 1;
Floor
Rounding in the negative infinity direction, such as floor (-1.3) =-2; Floor (1.3) = 1;
Ceil
Rounding toward positive infinity, e.g. ceil (-1.3) =-1; Ceil (1.3) = 2;
Round
Rounded to the nearest integer, such as round ( -1.3) =-1;round ( -1.52) =-2;round (1.3) =1;round (1.52) = 2.
Paper 68:matlab The use of the rounding function (fix, floor, ceil, round)