MATLAB: Converting all array elements into positive elements

converting all array elements into positive elements

I have an aray like this:
A=[1 -3 -1 4]
I would like to have the same elemnt but with all elements have been converted to positive
Then,
A=[1 3 1 4]
Any suggestions? Thank you in advance.

Best Answer

A = abs(A)