Y = abs(X);
Returns the absolute value of X or the elements of X.
X |
abs(X) |
1 |
1 |
2.1 |
2.1 |
-2.6 |
2.6 |
-1e-102 |
1e-102 |
[1.1,2.7;-3.6,-4] |
[1.1,2.7;3.6,4] |
• | X and Y must have the same size. |
• | For scalars, the abs function can also be written as: Y = |X|; |