MATLAB Answers


converting all array elements into positive elements

Asked by Mohammed Qahosh on 15 Jun 2019
Latest activity Commented on by Mohammed Qahosh on 16 Jun 2019
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
A=[1 3 1 4]
Any suggestions? Thank you in advance.


Sign in to comment.

1 Answer

Answer by madhan ravi
on 15 Jun 2019
 Accepted Answer

A = abs(A)

  1 Comment

madhan ravi Thank you very much for your help.

Sign in to comment.