Section: Mathematical Functions
y = fix(x)
where x
is a numeric array. For positive elements of x
, the output
is the largest integer smaller than x
. For negative elements of x
the output is the smallest integer larger than x
. For complex x
,
the operation is applied seperately to the real and imaginary parts.
fix
operation on some values
--> a = [-1.8,pi,8,-pi,-0.001,2.3+0.3i] a = <dcomplex> - size: [1 6] Columns 1 to 2 -1.800000000000000+ 0.000000000000000i 3.141592653589793+ 0.000000000000000i Columns 3 to 4 8.000000000000000+ 0.000000000000000i -3.141592653589793+ 0.000000000000000i Columns 5 to 6 -0.001000000000000+ 0.000000000000000i 2.300000000000000+ 0.300000000000000i --> fix(a) ans = <dcomplex> - size: [1 6] Columns 1 to 6 -1+ 0i 3+ 0i 8+ 0i -3+ 0i 0+ 0i 2+ 0i