Turn from http://blog.sina.com.cn/s/blog_48ebd4fb010009c2.html floor: round to negative infinity B = floor (a) rounds the elements of a to the nearest integers less than or equal to A. Ceil: Rounding toward positive infinity B = Ceil (a) rounds the elements of a to the nearest integers greater than or equal to a. FIX: Rounding in 0 direction B = fix (a) rounds the elements of a toward zero, resulting in an array of integers. Round: Rounding B = round (A) rounds the elements of X to the nearest integers. example:a= [ -0.9, -2.1, -0.4, 0.3, 0.8, 1.1, 2.7, -1.2+2.9i];
Floor (a) =[-1, -3,-1, 0, 0, 1, 2, -2+2i]
Ceil (a) = [0,-2, 0, 1, 1, 2, 3, -1+3i]
Fix (a) = [0,-2, 0, 0, 0, 1, 2, -1+2i]
Round (a) =[-1,-2, 0, 0, 1, 1, 3, -1+3i]
Note: For complex X, the four fuctions the imaginary and real parts is rounded independently.
About four rounding functions in MATLAB: Floor, Ceil, Fix, round explanation (RPM)