absAbsolute value or complex modulus
abs(A)A.A is complex, it returns the modulus of each element of A.A.A is empty.a is real, abs(a) gives the absolute values.a = [1 -1 0 1.2 -2.2];
abs(a)
ans =
1.000 1.000 0.000 1.200 2.200
a is complex, abs(a) gives the moduli.a = [1+i -1-2i 0+0i 1.2 -2.2];
abs(a)
ans =
1.414 2.236 0.000 1.200 2.200